Base
Base classes for all processors in this module. Also contains decorators for use in implementations.
Classes:
Generic base class for processors |
|
Processor that gets user input as part of it processing. |
|
|
Decorator for methods on a class decorated with the |
|
Base class for implementations with |
|
Base class for filtering down values based on some settings |
|
Composite filter which filters based on many |
- class musify.processors.base.Processor
Bases:
PrettyPrinter
Generic base class for processors
- class musify.processors.base.InputProcessor
Bases:
Processor
Processor that gets user input as part of it processing.
Contains methods for getting user input and printing formatted options text to the terminal.
Attributes:
The
MusifyLogger
for this object-
logger:
MusifyLogger
The
MusifyLogger
for this object
-
logger:
- class musify.processors.base.dynamicprocessormethod(*args)
Bases:
object
Decorator for methods on a class decorated with the
processor()
decoratorThis assigns the method a processor method which can be dynamically called by the processor class. Optionally, provide a list of alternative names from which this processor method can also be called.
- class musify.processors.base.DynamicProcessor(*_, **__)
Bases:
Processor
Base class for implementations with
dynamicprocessormethod()
methods.Classes that implement this base class have a
__processormethods__
class attribute which is a list of strings of all the processor methods this class contains. If adynamicprocessormethod()
has alternative method names, these names will be added to the class’__dict__
as callable methods which point to the decorated method.Optionally, you may also define a
_processor_method_fmt
class method which applies some transformation to all method names. The transformed method name is then appended to the class’__dict__
. The transformation is always applied before extending the class with any given alternative method names.Attributes:
String representation of all available processor names of this object
- property processor_methods: frozenset[str]
String representation of all available processor names of this object
- class musify.processors.base.Filter
Bases:
Processor
,Generic
Base class for filtering down values based on some settings
Attributes:
Does this filter have valid settings and can process values
Transform the input
value
to the value that should be used when comparing against this filter's settings Simply returns the givenvalue
at baseline unless overridden.Methods:
process
(values, *args, **kwargs)Apply this filter's settings to the given values
- abstract property ready: bool
Does this filter have valid settings and can process values
- abstract process(values, *args, **kwargs)
Apply this filter’s settings to the given values
- Return type:
Collection
[TypeVar
(T
)]
- property transform: Callable[[Any], Any]
Transform the input
value
to the value that should be used when comparing against this filter’s settings Simply returns the givenvalue
at baseline unless overridden.
- class musify.processors.base.FilterComposite(*filters, **__)
Bases:
Filter
,Collection
[Filter
],Generic
Composite filter which filters based on many
Filter
objectsAttributes:
Does this filter have valid settings and can process values
Transform the input
value
to the value that should be used when comparing against this filter's settings Simply returns the givenvalue
at baseline unless overridden.The filters to use when processing
- property ready
Does this filter have valid settings and can process values
- property transform: Callable[[Any], Any]
Transform the input
value
to the value that should be used when comparing against this filter’s settings Simply returns the givenvalue
at baseline unless overridden.
- filters
The filters to use when processing