Module ewa.rules
a rule system for ewa, used to determine what files should appear
before or after a main mp3 file in a composite mp3.
Rules are callables that take a single "filename" parameter
and return None or a generator that yields mp3 filenames (or equivalent
designations) in sequence.
A RuleList is a rule with a list of subrules, optionally with a
condition (matched against the filename). When the RuleList is called, if
the condition does not exist, or if it matches, each subrule is called on
the filename until one returns something, which is the return value.
Rules can be marshalled to and from JSON, and from (but currently not
to) the ewa rule configuration format implemented in ewa.ruleparser.
Function Summary |
|
extract_datetime(target,
regex,
format)
|
|
from_json(json)
|
|
GlobMatchRule(pattern,
pre,
post,
casesensitive)
|
|
RegexRule(pattern,
pre,
post,
flags)
|
|
to_json(data)
|