diff --git a/brother_ql/raster.py b/brother_ql/raster.py index eac214e..e037e2b 100644 --- a/brother_ql/raster.py +++ b/brother_ql/raster.py @@ -1,3 +1,11 @@ +""" +This module contains the implementation of the raster language +of the Brother QL-series label printers according to their +documentation and to reverse engineering efforts. + +The central piece of code in this module is the class +:py:class:`BrotherQLRaster`. +""" from builtins import bytes @@ -29,6 +37,21 @@ logger = logging.getLogger(__name__) class BrotherQLRaster(object): + """ + This class facilitates the creation of a complete set + of raster instructions by adding them one after the other + using the methods of the class. Each method call is adding + instructions to the member variable :py:attr:`data`. + + Instatiate the class by providing the printer + model as argument. + + :param str model: Choose from the list of available models. + + :ivar bytes data: The resulting bytecode with all instructions. + :ivar bool exception_on_warning: If set to True, an exception is raised if trying to add instruction which are not supported on the selected model. If set to False, the instruction is simply ignored and a warning sent to logging/stderr. + """ + def __init__(self, model='QL-500'): if model not in models: raise BrotherQLUnknownModel() @@ -169,6 +192,14 @@ class BrotherQLRaster(object): self.data += struct.pack('