zebra-day 1.0.2__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zebra_day-1.0.2/zebra_day.egg-info → zebra_day-2.0.0}/PKG-INFO +74 -13
- {zebra_day-1.0.2 → zebra_day-2.0.0}/README.md +73 -12
- {zebra_day-1.0.2 → zebra_day-2.0.0}/pyproject.toml +1 -1
- zebra_day-2.0.0/tests/test_auth.py +58 -0
- zebra_day-2.0.0/tests/test_cli.py +110 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/tests/test_core_functions.py +23 -11
- zebra_day-2.0.0/tests/test_exceptions.py +113 -0
- zebra_day-2.0.0/tests/test_logging.py +66 -0
- zebra_day-2.0.0/tests/test_paths.py +62 -0
- zebra_day-2.0.0/tests/test_setup_printers_json.py +83 -0
- zebra_day-2.0.0/tests/test_web_server.py +365 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cli/gui.py +89 -6
- zebra_day-2.0.0/zebra_day/etc/printer_config.json +4 -0
- zebra_day-2.0.0/zebra_day/etc/printer_config.template.json +24 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers120.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers145.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers207.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers469.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers485.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers531.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers540.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers542.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers552.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers715.json +10 -0
- zebra_day-2.0.0/zebra_day/etc/tmp_printers972.json +10 -0
- zebra_day-2.0.0/zebra_day/files/blank_preview.png +0 -0
- zebra_day-2.0.0/zebra_day/files/corners_20cmX30cm_preview.png +0 -0
- zebra_day-2.0.0/zebra_day/files/generic_2inX1in_preview.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_15472.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_24493.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_28157.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_30069.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_35832.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_47791.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_47799.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_55588.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_58809.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_67242.png +0 -0
- zebra_day-2.0.0/zebra_day/files/test_png_89893.png +0 -0
- zebra_day-2.0.0/zebra_day/files/tube_20mmX30mmA_preview.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/print_mgr.py +136 -80
- zebra_day-2.0.0/zebra_day/templates/modern/config_backups.html +59 -0
- zebra_day-2.0.0/zebra_day/templates/modern/config_editor.html +95 -0
- zebra_day-2.0.0/zebra_day/templates/modern/config_new.html +93 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/print_request.html +9 -5
- zebra_day-2.0.0/zebra_day/templates/modern/printer_detail.html +244 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/printers.html +17 -6
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/template_editor.html +7 -4
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/web/app.py +84 -7
- zebra_day-2.0.0/zebra_day/web/routers/api.py +313 -0
- zebra_day-2.0.0/zebra_day/web/routers/ui.py +636 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0/zebra_day.egg-info}/PKG-INFO +74 -13
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day.egg-info/SOURCES.txt +34 -40
- zebra_day-1.0.2/tests/test_setup_printers_json.py +0 -64
- zebra_day-1.0.2/tests/test_web_server.py +0 -8
- zebra_day-1.0.2/zebra_day/bin/fetch_zebra_config.py +0 -15
- zebra_day-1.0.2/zebra_day/bin/generate_coord_grid_zpl.py +0 -50
- zebra_day-1.0.2/zebra_day/bin/print_zpl_from_file.py +0 -21
- zebra_day-1.0.2/zebra_day/bin/probe_new_label_dimensions.py +0 -75
- zebra_day-1.0.2/zebra_day/bin/scan_for_networed_zebra_printers.py +0 -23
- zebra_day-1.0.2/zebra_day/bin/scan_for_networed_zebra_printers_arp_scan.sh +0 -1
- zebra_day-1.0.2/zebra_day/bin/scan_for_networed_zebra_printers_curl.sh +0 -30
- zebra_day-1.0.2/zebra_day/bin/zserve.py +0 -1062
- zebra_day-1.0.2/zebra_day/etc/printer_config.json +0 -16
- zebra_day-1.0.2/zebra_day/etc/printer_config.template.json +0 -16
- zebra_day-1.0.2/zebra_day/templates/base.html +0 -36
- zebra_day-1.0.2/zebra_day/templates/bpr.html +0 -72
- zebra_day-1.0.2/zebra_day/templates/build_new_config.html +0 -36
- zebra_day-1.0.2/zebra_day/templates/build_print_request.html +0 -32
- zebra_day-1.0.2/zebra_day/templates/chg_ui_style.html +0 -19
- zebra_day-1.0.2/zebra_day/templates/edit_template.html +0 -128
- zebra_day-1.0.2/zebra_day/templates/edit_zpl.html +0 -37
- zebra_day-1.0.2/zebra_day/templates/index.html +0 -82
- zebra_day-1.0.2/zebra_day/templates/legacy/base.html +0 -37
- zebra_day-1.0.2/zebra_day/templates/legacy/bpr.html +0 -72
- zebra_day-1.0.2/zebra_day/templates/legacy/build_new_config.html +0 -36
- zebra_day-1.0.2/zebra_day/templates/legacy/build_print_request.html +0 -32
- zebra_day-1.0.2/zebra_day/templates/legacy/chg_ui_style.html +0 -19
- zebra_day-1.0.2/zebra_day/templates/legacy/edit_template.html +0 -128
- zebra_day-1.0.2/zebra_day/templates/legacy/edit_zpl.html +0 -37
- zebra_day-1.0.2/zebra_day/templates/legacy/index.html +0 -82
- zebra_day-1.0.2/zebra_day/templates/legacy/list_prior_configs.html +0 -24
- zebra_day-1.0.2/zebra_day/templates/legacy/print_result.html +0 -30
- zebra_day-1.0.2/zebra_day/templates/legacy/printer_details.html +0 -25
- zebra_day-1.0.2/zebra_day/templates/legacy/printer_status.html +0 -70
- zebra_day-1.0.2/zebra_day/templates/legacy/save_result.html +0 -17
- zebra_day-1.0.2/zebra_day/templates/legacy/send_print_request.html +0 -34
- zebra_day-1.0.2/zebra_day/templates/legacy/simple_print.html +0 -94
- zebra_day-1.0.2/zebra_day/templates/legacy/view_pstation_json.html +0 -29
- zebra_day-1.0.2/zebra_day/templates/list_prior_configs.html +0 -24
- zebra_day-1.0.2/zebra_day/templates/modern/printer_detail.html +0 -117
- zebra_day-1.0.2/zebra_day/templates/print_result.html +0 -30
- zebra_day-1.0.2/zebra_day/templates/printer_details.html +0 -25
- zebra_day-1.0.2/zebra_day/templates/printer_status.html +0 -70
- zebra_day-1.0.2/zebra_day/templates/save_result.html +0 -17
- zebra_day-1.0.2/zebra_day/templates/send_print_request.html +0 -34
- zebra_day-1.0.2/zebra_day/templates/simple_print.html +0 -94
- zebra_day-1.0.2/zebra_day/templates/view_pstation_json.html +0 -29
- zebra_day-1.0.2/zebra_day/web/routers/api.py +0 -163
- zebra_day-1.0.2/zebra_day/web/routers/ui.py +0 -1051
- {zebra_day-1.0.2 → zebra_day-2.0.0}/LICENSE +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/MANIFEST.in +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/MODERNIZE.md +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/requirements-dev.txt +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/requirements.txt +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/setup.cfg +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/setup.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/tests/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/tests/test_creating_labels.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/bin/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cli/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cli/cognito.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cli/printer.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cli/template.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/cmd_mgr.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/Monoid-Regular-HalfTight-Dollar-0-1-l.ttf +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/blank.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/cornersStripOf4Squares_1inX1in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/corners_1inX2in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/corners_20cmX30cm.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/corners_smallTube.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/corners_unspecifiedDimensions.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/generic_2inX1in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/plate_1inX0.25in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/plate_1inX0.25inHD.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdotHD_prod.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_corners.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_prod.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_prodAlt1.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_prodAlt1b.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_prodV2.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/smallTubeWdot_reagent.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/stripOf4Squares_1inX1in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/test_800dX800dCoordinateArray.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tmps/.hold +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tmps/tmp_zpl_templates.here +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_20mmX30mmA.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX0.3in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX0.5in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX0.5inHD.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX1in.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX1inHD.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/label_styles/tube_2inX1inHDv3.zpl +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/.hold +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.022846_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.033657_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.039597_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.047295_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.055804_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:50:25.061337_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.073326_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.081950_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.088251_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.096501_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.104767_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.110364_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.118239_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.125950_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.349866_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.361085_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.558323_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:24.565756_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.739070_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.753796_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.760201_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.768747_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.775312_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.782533_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.789287_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.794230_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/old_printer_config/2026-02-01_01:51:29.800021_printer_config.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers0.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers374.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers383.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers450.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers504.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers608.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers657.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers838.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers839.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers933.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/etc/tmp_printers957.json +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/exceptions.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/.hold +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/hold +0 -0
- /zebra_day-1.0.2/zebra_day/files/test_png_28157.png → /zebra_day-2.0.0/zebra_day/files/test_png_12020.png +0 -0
- /zebra_day-1.0.2/zebra_day/files/test_png_35832.png → /zebra_day-2.0.0/zebra_day/files/test_png_12352.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_17696.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_23477.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_36400.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_40816.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_49564.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_53848.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_62542.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_91597.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/test_png_93633.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/tmpbjo3k7q1.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/tmpigtr4pwy.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/files/zpl_label_tube_2inX1in_2026-02-01_01:51:24.370964.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/logging_config.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/logs/.hold +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/logs/print_requests.log +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/paths.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/datschund.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/datschund.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/daylily.png +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/favicon.svg +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/general.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/js/zebra_modern.js +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/lsmc.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/moon.jpeg +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/oakland.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/petrichor.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/popday_daylily.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/style.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/triangles.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/tron.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/zebra_modern.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/static/zebras.css +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/base.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/config.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/dashboard.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/print_result.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/save_result.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/templates/modern/templates.html +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/web/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/web/auth.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/web/middleware.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/web/routers/__init__.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day/zpl_renderer.py +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day.egg-info/dependency_links.txt +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day.egg-info/entry_points.txt +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day.egg-info/requires.txt +0 -0
- {zebra_day-1.0.2 → zebra_day-2.0.0}/zebra_day.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zebra_day
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A Python library to manage a Zebra printer fleet and an API for ZPL print requests.
|
|
5
5
|
Home-page: https://github.com/Daylily-Informatics/zebra_day
|
|
6
6
|
Author: John Major
|
|
@@ -60,7 +60,7 @@ Dynamic: license-file
|
|
|
60
60
|
|
|
61
61
|
<img src=zebra_day/imgs/bar_red.png>
|
|
62
62
|
|
|
63
|
-
## zebra_day Overview [
|
|
63
|
+
## zebra_day Overview [2.0.0](https://github.com/Daylily-Informatics/zebra_day/releases/tag/2.0.0)
|
|
64
64
|
|
|
65
65
|
### Build, Deploy, Run, Monitor, Teardown
|
|
66
66
|
|
|
@@ -86,13 +86,13 @@ zday gui start # Start web UI in background
|
|
|
86
86
|
zday gui stop # Stop web UI
|
|
87
87
|
zday gui status # Check if web UI is running
|
|
88
88
|
|
|
89
|
-
# Health Checks
|
|
90
|
-
curl
|
|
91
|
-
curl
|
|
89
|
+
# Health Checks (use https:// if certificates are configured, http:// otherwise)
|
|
90
|
+
curl https://localhost:8118/healthz # Basic health check
|
|
91
|
+
curl https://localhost:8118/readyz # Readiness check (printer mgr initialized)
|
|
92
92
|
|
|
93
93
|
# API Documentation
|
|
94
|
-
# Visit
|
|
95
|
-
# Visit
|
|
94
|
+
# Visit https://localhost:8118/docs for interactive OpenAPI docs
|
|
95
|
+
# Visit https://localhost:8118/redoc for alternative API documentation
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
<ul>
|
|
@@ -181,7 +181,7 @@ zday status # Show printer fleet status, service health
|
|
|
181
181
|
zday bootstrap # First-time setup: scan network, initialize config
|
|
182
182
|
|
|
183
183
|
# GUI server management
|
|
184
|
-
zday gui start [--auth none|cognito] [--host HOST] [--port PORT]
|
|
184
|
+
zday gui start [--auth none|cognito] [--host HOST] [--port PORT] [--cert FILE] [--key FILE] [--no-https]
|
|
185
185
|
zday gui stop
|
|
186
186
|
zday gui status
|
|
187
187
|
zday gui logs [--tail N] [--follow]
|
|
@@ -213,6 +213,64 @@ The old commands `zday_start` and `zday_quickstart` still work but are deprecate
|
|
|
213
213
|
| `zday_start` | `zday gui start` |
|
|
214
214
|
| `zday_start --auth cognito` | `zday gui start --auth cognito` |
|
|
215
215
|
|
|
216
|
+
### Local HTTPS Setup
|
|
217
|
+
|
|
218
|
+
The zebra_day web UI supports HTTPS for secure local development. By default, HTTPS is enabled if certificates are found.
|
|
219
|
+
|
|
220
|
+
#### One-Time Setup (mkcert)
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Install mkcert
|
|
224
|
+
# macOS
|
|
225
|
+
brew install mkcert
|
|
226
|
+
|
|
227
|
+
# Ubuntu/Debian
|
|
228
|
+
sudo apt install mkcert
|
|
229
|
+
|
|
230
|
+
# Create and install local CA (one-time, requires password)
|
|
231
|
+
mkcert -install
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Generate Certificates for zebra_day
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Create certificate directory
|
|
238
|
+
mkdir -p ~/.config/zebra_day/certs
|
|
239
|
+
|
|
240
|
+
# Generate locally-trusted certificates
|
|
241
|
+
mkcert -cert-file ~/.config/zebra_day/certs/server.crt \
|
|
242
|
+
-key-file ~/.config/zebra_day/certs/server.key \
|
|
243
|
+
localhost 127.0.0.1 ::1
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### HTTPS Options
|
|
247
|
+
|
|
248
|
+
| Method | Description |
|
|
249
|
+
|--------|-------------|
|
|
250
|
+
| **Auto-detect** | If certs exist in `~/.config/zebra_day/certs/`, HTTPS is enabled automatically |
|
|
251
|
+
| **Explicit paths** | `zday gui start --cert /path/to/cert.crt --key /path/to/key.key` |
|
|
252
|
+
| **Environment vars** | Set `SSL_CERT_PATH` and `SSL_KEY_PATH` |
|
|
253
|
+
| **Force HTTP** | `zday gui start --no-https` |
|
|
254
|
+
|
|
255
|
+
#### Verify HTTPS
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Start server (will use HTTPS if certs are found)
|
|
259
|
+
zday gui start
|
|
260
|
+
|
|
261
|
+
# Test connection
|
|
262
|
+
curl https://localhost:8118/healthz
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### Troubleshooting
|
|
266
|
+
|
|
267
|
+
| Issue | Solution |
|
|
268
|
+
|-------|----------|
|
|
269
|
+
| Browser shows "Not Secure" | Run `mkcert -install` to trust the local CA |
|
|
270
|
+
| Certificate not found | Check paths: `ls ~/.config/zebra_day/certs/` |
|
|
271
|
+
| Permission denied | Ensure cert files are readable: `chmod 644 ~/.config/zebra_day/certs/*` |
|
|
272
|
+
| Want HTTP only | Use `--no-https` flag: `zday gui start --no-https` |
|
|
273
|
+
|
|
216
274
|
### It Is 3+ Things
|
|
217
275
|
|
|
218
276
|
(1) Zebra Printer Management & Configuration
|
|
@@ -502,10 +560,12 @@ zebra_day 0.6.0+ includes a redesigned modern UI alongside the preserved legacy
|
|
|
502
560
|
|
|
503
561
|
| Interface | URL | Description |
|
|
504
562
|
|-----------|-----|-------------|
|
|
505
|
-
| **Modern UI** | `
|
|
506
|
-
| **Legacy UI** | `
|
|
507
|
-
| **API Docs** | `
|
|
508
|
-
| **ReDoc** | `
|
|
563
|
+
| **Modern UI** | `https://localhost:8118/` | New dashboard with stats, quick actions, improved navigation |
|
|
564
|
+
| **Legacy UI** | `https://localhost:8118/legacy` | Original interface, fully functional |
|
|
565
|
+
| **API Docs** | `https://localhost:8118/docs` | Interactive OpenAPI/Swagger documentation |
|
|
566
|
+
| **ReDoc** | `https://localhost:8118/redoc` | Alternative API documentation |
|
|
567
|
+
|
|
568
|
+
> **Note:** Use `http://` instead of `https://` if running without certificates (`--no-https`).
|
|
509
569
|
|
|
510
570
|
Both interfaces provide full functionality. The modern UI offers:
|
|
511
571
|
- Dashboard with printer fleet statistics
|
|
@@ -579,7 +639,7 @@ When `--auth cognito` is enabled:
|
|
|
579
639
|
|
|
580
640
|
Include the JWT token in the Authorization header:
|
|
581
641
|
```bash
|
|
582
|
-
curl -H "Authorization: Bearer YOUR_JWT_TOKEN"
|
|
642
|
+
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" https://localhost:8118/api/v1/printers
|
|
583
643
|
```
|
|
584
644
|
|
|
585
645
|
### Secrets
|
|
@@ -784,3 +844,4 @@ Tthen run `sudo docker compose up --build -d` to run it then reach it at http://
|
|
|
784
844
|
|
|
785
845
|
|
|
786
846
|
|
|
847
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src=zebra_day/imgs/bar_red.png>
|
|
2
2
|
|
|
3
|
-
## zebra_day Overview [
|
|
3
|
+
## zebra_day Overview [2.0.0](https://github.com/Daylily-Informatics/zebra_day/releases/tag/2.0.0)
|
|
4
4
|
|
|
5
5
|
### Build, Deploy, Run, Monitor, Teardown
|
|
6
6
|
|
|
@@ -26,13 +26,13 @@ zday gui start # Start web UI in background
|
|
|
26
26
|
zday gui stop # Stop web UI
|
|
27
27
|
zday gui status # Check if web UI is running
|
|
28
28
|
|
|
29
|
-
# Health Checks
|
|
30
|
-
curl
|
|
31
|
-
curl
|
|
29
|
+
# Health Checks (use https:// if certificates are configured, http:// otherwise)
|
|
30
|
+
curl https://localhost:8118/healthz # Basic health check
|
|
31
|
+
curl https://localhost:8118/readyz # Readiness check (printer mgr initialized)
|
|
32
32
|
|
|
33
33
|
# API Documentation
|
|
34
|
-
# Visit
|
|
35
|
-
# Visit
|
|
34
|
+
# Visit https://localhost:8118/docs for interactive OpenAPI docs
|
|
35
|
+
# Visit https://localhost:8118/redoc for alternative API documentation
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
<ul>
|
|
@@ -121,7 +121,7 @@ zday status # Show printer fleet status, service health
|
|
|
121
121
|
zday bootstrap # First-time setup: scan network, initialize config
|
|
122
122
|
|
|
123
123
|
# GUI server management
|
|
124
|
-
zday gui start [--auth none|cognito] [--host HOST] [--port PORT]
|
|
124
|
+
zday gui start [--auth none|cognito] [--host HOST] [--port PORT] [--cert FILE] [--key FILE] [--no-https]
|
|
125
125
|
zday gui stop
|
|
126
126
|
zday gui status
|
|
127
127
|
zday gui logs [--tail N] [--follow]
|
|
@@ -153,6 +153,64 @@ The old commands `zday_start` and `zday_quickstart` still work but are deprecate
|
|
|
153
153
|
| `zday_start` | `zday gui start` |
|
|
154
154
|
| `zday_start --auth cognito` | `zday gui start --auth cognito` |
|
|
155
155
|
|
|
156
|
+
### Local HTTPS Setup
|
|
157
|
+
|
|
158
|
+
The zebra_day web UI supports HTTPS for secure local development. By default, HTTPS is enabled if certificates are found.
|
|
159
|
+
|
|
160
|
+
#### One-Time Setup (mkcert)
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Install mkcert
|
|
164
|
+
# macOS
|
|
165
|
+
brew install mkcert
|
|
166
|
+
|
|
167
|
+
# Ubuntu/Debian
|
|
168
|
+
sudo apt install mkcert
|
|
169
|
+
|
|
170
|
+
# Create and install local CA (one-time, requires password)
|
|
171
|
+
mkcert -install
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
#### Generate Certificates for zebra_day
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Create certificate directory
|
|
178
|
+
mkdir -p ~/.config/zebra_day/certs
|
|
179
|
+
|
|
180
|
+
# Generate locally-trusted certificates
|
|
181
|
+
mkcert -cert-file ~/.config/zebra_day/certs/server.crt \
|
|
182
|
+
-key-file ~/.config/zebra_day/certs/server.key \
|
|
183
|
+
localhost 127.0.0.1 ::1
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### HTTPS Options
|
|
187
|
+
|
|
188
|
+
| Method | Description |
|
|
189
|
+
|--------|-------------|
|
|
190
|
+
| **Auto-detect** | If certs exist in `~/.config/zebra_day/certs/`, HTTPS is enabled automatically |
|
|
191
|
+
| **Explicit paths** | `zday gui start --cert /path/to/cert.crt --key /path/to/key.key` |
|
|
192
|
+
| **Environment vars** | Set `SSL_CERT_PATH` and `SSL_KEY_PATH` |
|
|
193
|
+
| **Force HTTP** | `zday gui start --no-https` |
|
|
194
|
+
|
|
195
|
+
#### Verify HTTPS
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Start server (will use HTTPS if certs are found)
|
|
199
|
+
zday gui start
|
|
200
|
+
|
|
201
|
+
# Test connection
|
|
202
|
+
curl https://localhost:8118/healthz
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
#### Troubleshooting
|
|
206
|
+
|
|
207
|
+
| Issue | Solution |
|
|
208
|
+
|-------|----------|
|
|
209
|
+
| Browser shows "Not Secure" | Run `mkcert -install` to trust the local CA |
|
|
210
|
+
| Certificate not found | Check paths: `ls ~/.config/zebra_day/certs/` |
|
|
211
|
+
| Permission denied | Ensure cert files are readable: `chmod 644 ~/.config/zebra_day/certs/*` |
|
|
212
|
+
| Want HTTP only | Use `--no-https` flag: `zday gui start --no-https` |
|
|
213
|
+
|
|
156
214
|
### It Is 3+ Things
|
|
157
215
|
|
|
158
216
|
(1) Zebra Printer Management & Configuration
|
|
@@ -442,10 +500,12 @@ zebra_day 0.6.0+ includes a redesigned modern UI alongside the preserved legacy
|
|
|
442
500
|
|
|
443
501
|
| Interface | URL | Description |
|
|
444
502
|
|-----------|-----|-------------|
|
|
445
|
-
| **Modern UI** | `
|
|
446
|
-
| **Legacy UI** | `
|
|
447
|
-
| **API Docs** | `
|
|
448
|
-
| **ReDoc** | `
|
|
503
|
+
| **Modern UI** | `https://localhost:8118/` | New dashboard with stats, quick actions, improved navigation |
|
|
504
|
+
| **Legacy UI** | `https://localhost:8118/legacy` | Original interface, fully functional |
|
|
505
|
+
| **API Docs** | `https://localhost:8118/docs` | Interactive OpenAPI/Swagger documentation |
|
|
506
|
+
| **ReDoc** | `https://localhost:8118/redoc` | Alternative API documentation |
|
|
507
|
+
|
|
508
|
+
> **Note:** Use `http://` instead of `https://` if running without certificates (`--no-https`).
|
|
449
509
|
|
|
450
510
|
Both interfaces provide full functionality. The modern UI offers:
|
|
451
511
|
- Dashboard with printer fleet statistics
|
|
@@ -519,7 +579,7 @@ When `--auth cognito` is enabled:
|
|
|
519
579
|
|
|
520
580
|
Include the JWT token in the Authorization header:
|
|
521
581
|
```bash
|
|
522
|
-
curl -H "Authorization: Bearer YOUR_JWT_TOKEN"
|
|
582
|
+
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" https://localhost:8118/api/v1/printers
|
|
523
583
|
```
|
|
524
584
|
|
|
525
585
|
### Secrets
|
|
@@ -724,3 +784,4 @@ Tthen run `sudo docker compose up --build -d` to run it then reach it at http://
|
|
|
724
784
|
|
|
725
785
|
|
|
726
786
|
|
|
787
|
+
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zebra_day"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2.0.0"
|
|
8
8
|
description = "A Python library to manage a Zebra printer fleet and an API for ZPL print requests."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests for the zebra_day authentication module.
|
|
3
|
+
"""
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from zebra_day.web import auth
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestCognitoAvailability:
|
|
10
|
+
"""Tests for Cognito availability functions."""
|
|
11
|
+
|
|
12
|
+
def test_is_cognito_available_returns_bool(self):
|
|
13
|
+
"""Test is_cognito_available returns a boolean."""
|
|
14
|
+
result = auth.is_cognito_available()
|
|
15
|
+
assert isinstance(result, bool)
|
|
16
|
+
|
|
17
|
+
def test_get_cognito_import_error_returns_string_or_none(self):
|
|
18
|
+
"""Test get_cognito_import_error returns string or None."""
|
|
19
|
+
result = auth.get_cognito_import_error()
|
|
20
|
+
assert result is None or isinstance(result, str)
|
|
21
|
+
|
|
22
|
+
def test_cognito_available_matches_import_error(self):
|
|
23
|
+
"""Test that availability and import error are consistent."""
|
|
24
|
+
is_available = auth.is_cognito_available()
|
|
25
|
+
import_error = auth.get_cognito_import_error()
|
|
26
|
+
|
|
27
|
+
if is_available:
|
|
28
|
+
assert import_error is None
|
|
29
|
+
else:
|
|
30
|
+
assert import_error is not None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class TestPublicPaths:
|
|
34
|
+
"""Tests for PUBLIC_PATHS configuration."""
|
|
35
|
+
|
|
36
|
+
def test_public_paths_is_list(self):
|
|
37
|
+
"""Test PUBLIC_PATHS is a list."""
|
|
38
|
+
assert isinstance(auth.PUBLIC_PATHS, list)
|
|
39
|
+
|
|
40
|
+
def test_public_paths_contains_healthz(self):
|
|
41
|
+
"""Test PUBLIC_PATHS includes /healthz."""
|
|
42
|
+
assert "/healthz" in auth.PUBLIC_PATHS
|
|
43
|
+
|
|
44
|
+
def test_public_paths_contains_docs(self):
|
|
45
|
+
"""Test PUBLIC_PATHS includes /docs."""
|
|
46
|
+
assert "/docs" in auth.PUBLIC_PATHS
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class TestSetupCognitoAuth:
|
|
50
|
+
"""Tests for setup_cognito_auth function."""
|
|
51
|
+
|
|
52
|
+
def test_setup_cognito_raises_import_error_when_unavailable(self):
|
|
53
|
+
"""Test setup_cognito_auth raises ImportError when daylily-cognito not installed."""
|
|
54
|
+
if not auth.is_cognito_available():
|
|
55
|
+
with pytest.raises(ImportError) as exc_info:
|
|
56
|
+
auth.setup_cognito_auth(None)
|
|
57
|
+
assert "daylily-cognito" in str(exc_info.value)
|
|
58
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests for the zebra_day CLI commands.
|
|
3
|
+
"""
|
|
4
|
+
import pytest
|
|
5
|
+
from typer.testing import CliRunner
|
|
6
|
+
|
|
7
|
+
from zebra_day.cli import app, _get_version
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
runner = CliRunner()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestCLIVersion:
|
|
14
|
+
"""Tests for the version command."""
|
|
15
|
+
|
|
16
|
+
def test_get_version_returns_string(self):
|
|
17
|
+
"""Test _get_version returns a string."""
|
|
18
|
+
version = _get_version()
|
|
19
|
+
assert isinstance(version, str)
|
|
20
|
+
assert len(version) > 0
|
|
21
|
+
|
|
22
|
+
def test_version_command(self):
|
|
23
|
+
"""Test version command outputs version."""
|
|
24
|
+
result = runner.invoke(app, ["version"])
|
|
25
|
+
assert result.exit_code == 0
|
|
26
|
+
assert "zebra_day" in result.output
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class TestCLIInfo:
|
|
30
|
+
"""Tests for the info command."""
|
|
31
|
+
|
|
32
|
+
def test_info_command(self):
|
|
33
|
+
"""Test info command runs and shows table."""
|
|
34
|
+
result = runner.invoke(app, ["info"])
|
|
35
|
+
assert result.exit_code == 0
|
|
36
|
+
assert "Version" in result.output
|
|
37
|
+
assert "Config Dir" in result.output
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TestCLIStatus:
|
|
41
|
+
"""Tests for the status command."""
|
|
42
|
+
|
|
43
|
+
def test_status_command(self):
|
|
44
|
+
"""Test status command runs."""
|
|
45
|
+
result = runner.invoke(app, ["status"])
|
|
46
|
+
assert result.exit_code == 0
|
|
47
|
+
# Status shows printer counts
|
|
48
|
+
assert "Labs" in result.output or "Printer" in result.output
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class TestCLITemplateList:
|
|
52
|
+
"""Tests for template list command."""
|
|
53
|
+
|
|
54
|
+
def test_template_list_command(self):
|
|
55
|
+
"""Test template list command runs."""
|
|
56
|
+
result = runner.invoke(app, ["template", "list"])
|
|
57
|
+
assert result.exit_code == 0
|
|
58
|
+
# Should show templates or empty list
|
|
59
|
+
assert "Template" in result.output or "Stable" in result.output or result.exit_code == 0
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TestCLIPrinterList:
|
|
63
|
+
"""Tests for printer list command."""
|
|
64
|
+
|
|
65
|
+
def test_printer_list_command(self):
|
|
66
|
+
"""Test printer list command runs."""
|
|
67
|
+
result = runner.invoke(app, ["printer", "list"])
|
|
68
|
+
assert result.exit_code == 0
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class TestCLIHelp:
|
|
72
|
+
"""Tests for CLI help output."""
|
|
73
|
+
|
|
74
|
+
def test_main_help(self):
|
|
75
|
+
"""Test main help shows subcommands."""
|
|
76
|
+
result = runner.invoke(app, ["--help"])
|
|
77
|
+
assert result.exit_code == 0
|
|
78
|
+
assert "gui" in result.output
|
|
79
|
+
assert "printer" in result.output
|
|
80
|
+
assert "template" in result.output
|
|
81
|
+
|
|
82
|
+
def test_gui_help(self):
|
|
83
|
+
"""Test gui subcommand help."""
|
|
84
|
+
result = runner.invoke(app, ["gui", "--help"])
|
|
85
|
+
assert result.exit_code == 0
|
|
86
|
+
assert "start" in result.output
|
|
87
|
+
assert "stop" in result.output
|
|
88
|
+
|
|
89
|
+
def test_printer_help(self):
|
|
90
|
+
"""Test printer subcommand help."""
|
|
91
|
+
result = runner.invoke(app, ["printer", "--help"])
|
|
92
|
+
assert result.exit_code == 0
|
|
93
|
+
assert "list" in result.output
|
|
94
|
+
|
|
95
|
+
def test_template_help(self):
|
|
96
|
+
"""Test template subcommand help."""
|
|
97
|
+
result = runner.invoke(app, ["template", "--help"])
|
|
98
|
+
assert result.exit_code == 0
|
|
99
|
+
assert "list" in result.output
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class TestCLIGuiStatus:
|
|
103
|
+
"""Tests for GUI status command."""
|
|
104
|
+
|
|
105
|
+
def test_gui_status_command(self):
|
|
106
|
+
"""Test gui status command runs."""
|
|
107
|
+
result = runner.invoke(app, ["gui", "status"])
|
|
108
|
+
# exit_code 0 = running, exit_code 1 = not running (both valid)
|
|
109
|
+
assert result.exit_code in (0, 1)
|
|
110
|
+
|
|
@@ -106,15 +106,23 @@ class TestConfigJsonRoundtrip:
|
|
|
106
106
|
zd_pm = zd.zpl()
|
|
107
107
|
zd_pm.clear_printers_json()
|
|
108
108
|
|
|
109
|
-
# Add test data
|
|
109
|
+
# Add test data with v2 schema structure
|
|
110
110
|
zd_pm.printers["labs"]["roundtrip_test"] = {
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
"lab_name": "Roundtrip Test Lab",
|
|
112
|
+
"available_locations": ["Bench A", "Bench B"],
|
|
113
|
+
"printers": {
|
|
114
|
+
"TestPrinter": {
|
|
115
|
+
"ip_address": "10.0.0.99",
|
|
116
|
+
"printer_name": "Test Printer Display Name",
|
|
117
|
+
"lab_location": "Bench A",
|
|
118
|
+
"manufacturer": "zebra",
|
|
119
|
+
"label_zpl_styles": ["tube_2inX1in"],
|
|
120
|
+
"print_method": "socket",
|
|
121
|
+
"model": "ZD421",
|
|
122
|
+
"serial": "TEST123",
|
|
123
|
+
"arp_data": "na",
|
|
124
|
+
"notes": ""
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
|
|
@@ -134,7 +142,9 @@ class TestConfigJsonRoundtrip:
|
|
|
134
142
|
|
|
135
143
|
assert "labs" in loaded
|
|
136
144
|
assert "roundtrip_test" in loaded["labs"]
|
|
137
|
-
|
|
145
|
+
# v2 schema: printers are nested
|
|
146
|
+
assert loaded["labs"]["roundtrip_test"]["printers"]["TestPrinter"]["ip_address"] == "10.0.0.99"
|
|
147
|
+
assert loaded["labs"]["roundtrip_test"]["printers"]["TestPrinter"]["printer_name"] == "Test Printer Display Name"
|
|
138
148
|
|
|
139
149
|
# Load into new instance
|
|
140
150
|
zd_pm2 = zd.zpl()
|
|
@@ -164,9 +174,11 @@ class TestConfigJsonRoundtrip:
|
|
|
164
174
|
zd_pm.create_new_printers_json_with_single_test_printer()
|
|
165
175
|
|
|
166
176
|
assert "scan-results" in zd_pm.printers["labs"]
|
|
167
|
-
|
|
177
|
+
# v2 schema: printers are nested under 'printers' key
|
|
178
|
+
assert "printers" in zd_pm.printers["labs"]["scan-results"]
|
|
179
|
+
assert "Download-Label-png" in zd_pm.printers["labs"]["scan-results"]["printers"]
|
|
168
180
|
assert (
|
|
169
|
-
zd_pm.printers["labs"]["scan-results"]["Download-Label-png"]["ip_address"]
|
|
181
|
+
zd_pm.printers["labs"]["scan-results"]["printers"]["Download-Label-png"]["ip_address"]
|
|
170
182
|
== "dl_png"
|
|
171
183
|
)
|
|
172
184
|
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests for the zebra_day exceptions module.
|
|
3
|
+
"""
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from zebra_day import exceptions
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestZebraDayError:
|
|
10
|
+
"""Tests for base ZebraDayError."""
|
|
11
|
+
|
|
12
|
+
def test_can_raise_base_error(self):
|
|
13
|
+
"""Test ZebraDayError can be raised."""
|
|
14
|
+
with pytest.raises(exceptions.ZebraDayError):
|
|
15
|
+
raise exceptions.ZebraDayError("test error")
|
|
16
|
+
|
|
17
|
+
def test_base_error_has_message(self):
|
|
18
|
+
"""Test ZebraDayError preserves message."""
|
|
19
|
+
err = exceptions.ZebraDayError("test message")
|
|
20
|
+
assert "test message" in str(err)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class TestPrinterConnectionError:
|
|
24
|
+
"""Tests for PrinterConnectionError."""
|
|
25
|
+
|
|
26
|
+
def test_printer_connection_error_includes_ip(self):
|
|
27
|
+
"""Test PrinterConnectionError includes IP address."""
|
|
28
|
+
err = exceptions.PrinterConnectionError("192.168.1.100", "timeout")
|
|
29
|
+
assert "192.168.1.100" in str(err)
|
|
30
|
+
assert err.printer_ip == "192.168.1.100"
|
|
31
|
+
|
|
32
|
+
def test_printer_connection_error_includes_message(self):
|
|
33
|
+
"""Test PrinterConnectionError includes message."""
|
|
34
|
+
err = exceptions.PrinterConnectionError("192.168.1.100", "connection refused")
|
|
35
|
+
assert "connection refused" in str(err)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class TestPrinterNotFoundError:
|
|
39
|
+
"""Tests for PrinterNotFoundError."""
|
|
40
|
+
|
|
41
|
+
def test_printer_not_found_includes_name(self):
|
|
42
|
+
"""Test PrinterNotFoundError includes printer name."""
|
|
43
|
+
err = exceptions.PrinterNotFoundError("my-printer")
|
|
44
|
+
assert "my-printer" in str(err)
|
|
45
|
+
assert err.printer_name == "my-printer"
|
|
46
|
+
|
|
47
|
+
def test_printer_not_found_includes_lab(self):
|
|
48
|
+
"""Test PrinterNotFoundError includes lab when provided."""
|
|
49
|
+
err = exceptions.PrinterNotFoundError("my-printer", lab="lab-1")
|
|
50
|
+
assert "my-printer" in str(err)
|
|
51
|
+
assert "lab-1" in str(err)
|
|
52
|
+
assert err.lab == "lab-1"
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TestConfigError:
|
|
56
|
+
"""Tests for ConfigError and subclasses."""
|
|
57
|
+
|
|
58
|
+
def test_config_error(self):
|
|
59
|
+
"""Test ConfigError basic usage."""
|
|
60
|
+
err = exceptions.ConfigError("config problem", config_path="/path/to/config")
|
|
61
|
+
assert "config problem" in str(err)
|
|
62
|
+
assert err.config_path == "/path/to/config"
|
|
63
|
+
|
|
64
|
+
def test_config_file_not_found_error(self):
|
|
65
|
+
"""Test ConfigFileNotFoundError includes path."""
|
|
66
|
+
err = exceptions.ConfigFileNotFoundError("/path/to/config.json")
|
|
67
|
+
assert "/path/to/config.json" in str(err)
|
|
68
|
+
assert err.config_path == "/path/to/config.json"
|
|
69
|
+
|
|
70
|
+
def test_config_parse_error(self):
|
|
71
|
+
"""Test ConfigParseError includes details."""
|
|
72
|
+
err = exceptions.ConfigParseError("/path/to/config.json", "invalid JSON")
|
|
73
|
+
assert "/path/to/config.json" in str(err)
|
|
74
|
+
assert "invalid JSON" in str(err)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class TestLabelTemplateError:
|
|
78
|
+
"""Tests for LabelTemplateError and subclasses."""
|
|
79
|
+
|
|
80
|
+
def test_label_template_error(self):
|
|
81
|
+
"""Test LabelTemplateError basic usage."""
|
|
82
|
+
err = exceptions.LabelTemplateError("my_template", "invalid syntax")
|
|
83
|
+
assert "my_template" in str(err)
|
|
84
|
+
assert "invalid syntax" in str(err)
|
|
85
|
+
assert err.template_name == "my_template"
|
|
86
|
+
|
|
87
|
+
def test_label_template_not_found_error(self):
|
|
88
|
+
"""Test LabelTemplateNotFoundError includes name."""
|
|
89
|
+
err = exceptions.LabelTemplateNotFoundError("missing_template")
|
|
90
|
+
assert "missing_template" in str(err)
|
|
91
|
+
assert "not found" in str(err)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class TestZPLRenderError:
|
|
95
|
+
"""Tests for ZPLRenderError."""
|
|
96
|
+
|
|
97
|
+
def test_zpl_render_error(self):
|
|
98
|
+
"""Test ZPLRenderError basic usage."""
|
|
99
|
+
err = exceptions.ZPLRenderError("invalid ZPL code")
|
|
100
|
+
assert "invalid ZPL code" in str(err)
|
|
101
|
+
assert "render error" in str(err).lower()
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class TestNetworkScanError:
|
|
105
|
+
"""Tests for NetworkScanError."""
|
|
106
|
+
|
|
107
|
+
def test_network_scan_error(self):
|
|
108
|
+
"""Test NetworkScanError basic usage."""
|
|
109
|
+
err = exceptions.NetworkScanError("192.168.1", "timeout during scan")
|
|
110
|
+
assert "192.168.1" in str(err)
|
|
111
|
+
assert "timeout" in str(err)
|
|
112
|
+
assert err.ip_stub == "192.168.1"
|
|
113
|
+
|