Config¶
Module escpos.config
ESC/POS configuration manager.
This module contains the implentations of abstract base class Config
.
-
class
escpos.config.
Config
¶ Bases:
object
Configuration handler class.
This class loads configuration from a default or specificed directory. It can create your defined printer and return it to you.
-
load
(config_path=None)¶ Load and parse the configuration file using pyyaml
Parameters: config_path – An optional file path, file handle, or byte string for the configuration file.
-
printer
()¶ Returns a printer that was defined in the config, or throws an exception.
This method loads the default config if one hasn’t beeen already loaded.
-