Config

Module escpos.config

ESC/POS configuration manager.

This module contains the implementations of abstract base class Config.

class escpos.config.Config[source]

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)[source]

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()[source]

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.