From 66a2e31442627d3b41fd5d410b724f4699976f96 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Thu, 10 Nov 2016 21:43:35 +0100 Subject: [PATCH] adding brother_ql_info for --list-models and --list-label-sizes --- brother_ql/brother_ql_info.py | 28 ++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 29 insertions(+) create mode 100755 brother_ql/brother_ql_info.py diff --git a/brother_ql/brother_ql_info.py b/brother_ql/brother_ql_info.py new file mode 100755 index 0000000..1b1241e --- /dev/null +++ b/brother_ql/brother_ql_info.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import argparse + +from brother_ql.devicedependent import models, label_sizes, label_type_specs, DIE_CUT_LABEL, ENDLESS_LABEL, ROUND_DIE_CUT_LABEL + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--list-label-sizes', action='store_true', help='List available label sizes') + parser.add_argument('--list-models', action='store_true', help='List available models') + args = parser.parse_args() + + if args.list_models: + print('Supported models:') + for model in models: print(" " + model) + + if args.list_label_sizes: + print('Supported label sizes:') + for label_size in label_sizes: + s = label_type_specs[label_size] + descr = " %-10s " % label_size + if s['kind'] == DIE_CUT_LABEL: descr += "(%d x %d mm^2)" % s['tape_size'] + if s['kind'] == ENDLESS_LABEL: descr += "(%d mm endless)" % s['tape_size'][0] + if s['kind'] == ROUND_DIE_CUT_LABEL: descr += "(%d mm diameter, round)" % s['tape_size'][0] + print(descr) + + +if __name__ == "__main__": main() diff --git a/setup.py b/setup.py index 0c3282e..19769c7 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ setup(name='brother_ql', 'brother_ql_create = brother_ql.brother_ql_create:main', 'brother_ql_print = brother_ql.brother_ql_print:main', 'brother_ql_debug = brother_ql.brother_ql_debug:main', + 'brother_ql_info = brother_ql.brother_ql_info:main', 'brother_ql_web = brother_ql.web.__init__:main', ], },