anyconfig.models.processor
¶
Abstract processor module.
Added in version 0.9.5:
Add to abstract processors such like Parsers (loaders and dumpers).
- class anyconfig.models.processor.Processor¶
Bases:
object
Abstract processor class to provide basic implementation.
_type: type indicates data types it can process
- _priority:
Priority to select it if there are others of same type from 0 (lowest) to 99 (highest)
_extensions: File extensions of data type it can process
Note
This class ifself is not a singleton but its children classes should so in most cases, I think.
-
_cid:
ClassVar
[str
] = ''¶
-
_type:
ClassVar
[str
] = ''¶
-
_priority:
ClassVar
[int
] = 0¶
-
_extensions:
tuple
[str
,...
] = ()¶
- classmethod cid()¶
Processor class ID.
- Return type:
str
- classmethod type()¶
Processors’ type.
- Return type:
str
- classmethod priority()¶
Processors’s priority.
- Return type:
int
- classmethod extensions()¶
Get the list of file extensions of files it can process.
- Return type:
tuple
[str
,...
]
- classmethod __eq__(other)¶
Test equality.
- Return type:
bool
- __str__()¶
Provide a string representation.
- Return type:
str
- __annotations__ = {'_cid': 'typing.ClassVar[str]', '_extensions': 'tuple[str, ...]', '_priority': 'typing.ClassVar[int]', '_type': 'typing.ClassVar[str]'}¶
- __dict__ = mappingproxy({'__module__': 'anyconfig.models.processor', '__annotations__': {'_cid': 'typing.ClassVar[str]', '_type': 'typing.ClassVar[str]', '_priority': 'typing.ClassVar[int]', '_extensions': 'tuple[str, ...]'}, '__doc__': 'Abstract processor class to provide basic implementation.\n\n - _type: type indicates data types it can process\n - _priority:\n Priority to select it if there are others of same type from 0 (lowest)\n to 99 (highest)\n - _extensions: File extensions of data type it can process\n\n .. note::\n This class ifself is not a singleton but its children classes should so\n in most cases, I think.\n ', '_cid': '', '_type': '', '_priority': 0, '_extensions': (), 'cid': <classmethod(<function Processor.cid>)>, 'type': <classmethod(<function Processor.type>)>, 'priority': <classmethod(<function Processor.priority>)>, 'extensions': <classmethod(<function Processor.extensions>)>, '__eq__': <classmethod(<function Processor.__eq__>)>, '__str__': <function Processor.__str__>, '__dict__': <attribute '__dict__' of 'Processor' objects>, '__weakref__': <attribute '__weakref__' of 'Processor' objects>, '__hash__': None})¶
- __hash__ = None¶
- __module__ = 'anyconfig.models.processor'¶
- __weakref__¶
list of weak references to the object (if defined)