fedex.printers.unix.DirectDevicePrinter

Package fedex :: Package printers :: Module unix :: Class DirectDevicePrinter |
[hide private]
[frames] | no frames]

# Class DirectDevicePrinter

source code

This class pipes the label data directly through a /dev/* entry. Consequently, this is very Unix/Linux specific. It *MAY* work on Mac too.

Instance Methods | [hide private]
__init__(self, shipment, device=`'``/dev/ttyS0``'`) Instantiates from a shipment object. | source code
print_label(self, package_num=None) Prints all of a shipment's labels, or optionally just one. | source code
_print_base64(self, base64_data) Pipe the binary directly to the label printer. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Instance Variables | [hide private]
| device A string with the path to the device to print to.
| shipment A reference to the FedexProcessShipmentRequest to print.

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, shipment, device=`'``/dev/ttyS0``'`) (Constructor) | source code
Instantiates from a shipment object. You may optionally specify a path to a /dev/ device. Defaults to /dev/ttyS0. Parameters: `shipment` (FedexProcessShipmentRequest) - A Fedex ProcessShipmentRequest object to pull the printed label data from. Overrides: object.__init__

### print_label(self, package_num=None) | source code
Prints all of a shipment's labels, or optionally just one. Parameters: `package_num` (`int`) - 0-based index of the package to print. This is only useful for shipments with more than one package.

### _print_base64(self, base64_data) | source code
Pipe the binary directly to the label printer. Works under Linux without requiring PySerial. This is not typically something you should call directly, unless you have special needs. Parameters: `base64_data` (`str`) - The base64 encoded string for the label to print.