types1585%python.module
fault.project

Factored Projects data structures and types.

FactorType

Annotation signature for factor data produced by project protocols.

FactorType = tuple[
	tuple[FactorPath, Reference], # Project relative path and type.
	tuple[
		Set[Reference], # Requirements
		Iterable[tuple[Reference, Path]], # Format References and Sources
	],
]

Mapping
import

Iterable
import

Set
import

dataclass0
import

tools0
import

Segment0
import

Path0
import

ignored0
data

ignored = {
	'__pycache__',
	'__f-int__',
	'.f-int',
	'.git',
	'.svn',
	'.hg',
	'.darcs',
	'.pijul',
}

@tools.struct()

Variants0
class

Factor image variant specification. A triple of contrived identifiers that represent a classification.

VariantsProperties

system

Identifier of the runtime environment; normally, an operating system name. Often, derived from uname.

architecture

Identifier for the instruction set or format. Often, derived from uname.

form

Identifier for the specialization of the image.

Defaults to 'executable'; the most likely intent of an image.

This is has no semantic relation to factor types; it is provided to allow parallel storage of data that serves a purpose other than supporting the execution of a project's functionality.

Variantsform0
data
str

form:(str) = 'executable'

Variants__repr__20%
method

__repr__(self)

Variants__str__10%
method

__str__(self)

Variantsget150%
method
str

get(self, key)

Variantsreform0
method

reform(self, rform)

Reconstruct the instance with the given rform as the new form value.

Format0
class

Source format structure holding the language and dialect.

Formatdialect0
data
str

dialect:(str) = None
	@classmethod

Formatfrom_string0
classmethod

from_string()

Split the format identifier by the first . in string. Creates an instance using the first field as the language and second as the dialect. If there is no . or the dialect is an empty string, the dialect will be None,

FactorPath0
class

A fault.route.types.Segment identifying a factor.

The path is always relative; usually relative to either a product or project. Identifiers in the path exclude any filename extensions.

FactorPath__str__0
method

__str__(self)

FactorPath__repr__0
method

__repr__(self)

FactorPath__matmul__0
method

__matmul__(self, fpath)

Relative and absolute constructor.

factor0
data

factor = FactorPath(None, ())

@dataclass

FactorContextPaths0
class

File System Information regarding the context of a Factor.

This data structure is used to hold the set of directories related to an Archived Factor.

FactorContextPathsProperties

root

The route containing either the project or the context enclosure. Also known as the Product Directory.

context

The context project relevant to project. None if the project is not managed within a Project Context.

project

The route identifying the project.

FactorContextPathsroot0
data
Path

root: (Path) = None

FactorContextPathscontext0
data
FactorPath

context: (FactorPath) = None

FactorContextPathsproject0
data
Path

project: (Path) = None
	@property

FactorContextPathsenclosure233%
property
bool

Whether the original subject was referring to an enclosure.

FactorContextPathsselect40%
method

select(self, factor)

FactorContextPathsfactor20%
method

factor(self)

Construct a project factor path.

Information0
class

Project information structure usually extracted from project.txt files.

InformationProperties

identifier

A hyperlink or literal attempting to provide a unique string that can be used to identify the project.

name

The canonical local name for the project. Often, consistent with the directory or file containing the project's factors.

authority

An arbitrary string intended to identify the entity that controls the project.

contact

A string that identifies the appropriate means of contacting the authority regarding the project.

Informationidentifier0
data
str

identifier: (str) = None

Informationname0
data
str

name: (str) = None

Informationauthority0
data
str

authority: (str) = None

Informationcontact0
data
str

	contact: (str) = None

@dataclass

Extensions0
class

Project information extensions.

ExtensionsProperties

icon

A hyperlink identifying an image that represents or symbolizes the project.

synopsis

A brief, single sentence, description of the project.

Extensionsicon0
data
str

icon: (str) = None

Extensionssynopsis0
data
str

	synopsis: (str) = None

@tools.struct()

Reference0
class

A position independent reference to a required factor and the interpretation parameters needed to properly form the relationship for integration.

project and factor are the only required fields.

ReferenceProperties

project

The identifier of the project that contains the required factor.

factor

The project relative path to the required factor. If empty, the reference is identifying the entire project.

method

The type of connection that is expected to be formed between the requirement and the target factor being integrated.

isolation

The specifier of a format, variant, or factor type.

For type methods, this is usually a reference to a language identifier. For control, it can be the specification of a feature's variant.

When referring to normal requirements, this is always the factor type that should be used when integration is performed.

format

In the case of type references, format provides access to a structured form of isolation: a Format instance.

Referencemethod0
data
str

method: (str) = None

Referenceisolation0
data
str

isolation: (str) = None

Referenceisolate0
method

isolate(self, isolation)

Reconstruct the reference replacing its isolation field the given isolation.

If isolation is already set, return self.

Reference__str__175%
method

__str__(self)

Referenceformat0
property

Construct the Format instance representing the isolation.

Format instances are cached and repeat reads across references with the same isolation should normally return the same object.

Referencefrom_ri0
classmethod

from_ri(Class, method, ri)

Create a reference from a resource indicator. Splits on the fragment and the final path segment.

FactorIsolationProtocol0
class

A project factor protocol.

FactorIsolationProtocol__init__0
method

__init__(self, parameters)

FactorIsolationProtocolinformation150%
method
Information

information(self, route)

FactorIsolationProtocoliterfactors150%
method
Iterable[FactorType]

iterfactors(self, route)

Protocol0
data

Protocol = FactorIsolationProtocol

ProtocolViolation0
class

The route was identified as not conforming to the protocol.

fpc0
function
FactorPath

fpc(context, factorpath, root)

FactorPath instance cache for relative and absolute paths constructed from strings.

When factorpath has leading periods, ., the number of periods will select the ancestor of context to start the resulting FactorPath from.

fpcParameters

context

The relative position factorpath is to be interpreted from when leading periods are present.

factorpath

The string that is being interpreted to become a FactorPath instance.

root

The absolute position that factorpath will extend given that it is not relative.