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.

Logs a random line from the file passed at initialization.

Parameters:system – Not used
Return type:None

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

Parameters:filehandle ([str]) – A file opened for reading.
Yields:str – All stripped elements of filehandle that are not empty.