vermouth.processors.quote module

Reads quotes, and produces a random one.

class vermouth.processors.quote.Quoter(quote_file=None)[source]

Bases: vermouth.processors.processor.Processor

Processor that can produce random string taken from a file. Useful for e.g. quotes.

Parameters

quote_file (pathlib.Path or str) – The path of the file containing the strings. Must contain at least one line.

run_system(system)[source]

Logs a random line from the file passed at initialization.

Parameters

system – Not used

Returns

Return type

None

vermouth.processors.quote.read_quote_file(filehandle)[source]

Iterates over filehandle, and yields all strings that are not empty.

Parameters

filehandle (collections.abc.Iterable[str]) – A file opened for reading.

Yields

str – All stripped elements of filehandle that are not empty.