rattail.isv.cam32.pdt

rattail.isv.cam32.pdt – Portable Data Terminal Interface

rattail.isv.cam32.pdt.combine_entries(entries)

Condenses a list of PDT entries (as returned by rattail.isv.cam32.pdt.parse_file()) so that there is only one entry per rattail.isv.cam32.classes.InventoryItem instance.

Note

The list is not modified in-place, but rather a new list is returned.

rattail.isv.cam32.pdt.create_file(entries, path=None, sort=True, progress_factory=None)

Creates a PDT file containing the given entries, which should be a sequence of tuples in the form (item_number, quantity).

A path may be specified; if not then the default PDTREC.FIL path is assumed.

The entries will be sorted by item_number before creating the file, unless sort is False.

A standard progress factory may also be provided.

Returns the path of the output file, or None if the process was cancelled via the progress object.

rattail.isv.cam32.pdt.file_exists()

Returns True if the PDT file (as returned by cam32.config.get_file_path()) exists; False if not.

rattail.isv.cam32.pdt.get_file_path()

Returns the path to CAM32’s “PDT” file, which should reside in the PUBLIC folder.

rattail.isv.cam32.pdt.parse_file(path=None, progress_factory=None)

Parses a PDT file and returns a list of item entries found within it. Each entry is represented as a tuple of (Item, quantity).

If path is not provided, the “live” PDT file will be assumed.

A progress factory may be provided.

If processing is interrupted, this function will return None. Otherwise, the list of item tuples is returned.

Previous topic

rattail.isv.cam32.inventory

Next topic

rattail.isv.cam32.pricing

This Page