diff options
| -rw-r--r-- | cables.py | 2 | ||||
| -rw-r--r-- | main.py | 17 | ||||
| -rw-r--r-- | switches.py | 1 | 
3 files changed, 19 insertions, 1 deletions
| diff --git a/cables.py b/cables.py new file mode 100644 index 0000000..f32d7bc --- /dev/null +++ b/cables.py @@ -0,0 +1,2 @@ +def make_cable_labels(): +    print("Generating labels for cables") @@ -1,5 +1,20 @@ +import argparse +import sys +  from switches import make_switch_labels +from cables import make_cable_labels +parser = argparse.ArgumentParser("Label generator script 2000") +parser.add_argument("labler", type=str, +                    help="The label function to run. Either [c]ables or [s]witches.")  if __name__ == "__main__": -    make_switch_labels() +    args = parser.parse_args() + +    if args.labler[0] == "c": +        make_cable_labels() +    elif args.labler[0] == "s": +        make_switch_labels() +    else: +        parser.print_help() +        sys.exit("Invalid labler operation.") diff --git a/switches.py b/switches.py index dbc7ece..d6c80a7 100644 --- a/switches.py +++ b/switches.py @@ -40,6 +40,7 @@ def write_html_to_file(html, outfile="switch_labels.html"):  def make_switch_labels(): +    print("Generating labels for switches")      switches = fetch_gondul_switches()      labels = generate_labels(switches)      write_html_to_file(labels) | 
