stylist.configuration
Handles configuration parameters coming from various potential sources.
Configuration may be defined by software or read from a Windows .ini file.
Classes
|
Core configuration functionality. |
|
Configuration parameters read from a Windows '.ini' format file. |
- class stylist.configuration.Configuration(parameters=None, defaults=None)
Bases:
abc.ABC
Core configuration functionality.
- Parameters
parameters (
Optional
[Mapping
[str
,Mapping
[str
,str
]]]) – Maps section to key/value pairs.defaults (
Optional
[Configuration
]) – Configuration to fall back to.
- available_styles()
Gets a list of all available styles.
- Return type
Sequence
[str
]
- get_file_pipes()
Enumerates the extension handling pipelines.
- Return type
Sequence
[Tuple
[str
,Type
[SourceTree
],Sequence
[Type
[TextProcessor
]]]]
- get_style(name)
Gets the rules associated with the provided style name.
- Parameters
name (
str
) – Style name.- Return type
Sequence
[str
]
- classmethod language_lookup(key)
Gets the source class associated with a particular language.
- Parameters
key (
str
) – Language identifier as returned by language_tags.- Return type
Type
[SourceTree
]
- classmethod language_tags()
Gets the languages understood by this configuration.
- Return type
Sequence
[str
]
- classmethod parse_pipe_description(string)
Converts a pipeline description into classes.
- Parameters
string (
str
) – Colon-separated list of pipeline stages.- Return type
Tuple
[str
,Type
[SourceTree
],Sequence
[Type
[TextProcessor
]]]
- classmethod preprocessor_lookup(key)
Gets the class associated with a particular preprocessor.
- Parameters
key (
str
) – Preprocessor identifier as returned by preprocessor_tags.- Return type
Type
[TextProcessor
]
- classmethod preprocessor_tags()
Gets the preprocessors understood by this configuration.
- class stylist.configuration.ConfigurationFile(filename, defaults=None)
Bases:
stylist.configuration.Configuration
Configuration parameters read from a Windows ‘.ini’ format file.
- Parameters
filename (
Path
) – Path to ‘.ini’ file.defaults (
Optional
[Configuration
]) – Configuration to fall back to.