zebra-day 0.0.37__py3-none-any.whl → 1.0.2__py3-none-any.whl
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/__init__.py +35 -0
- zebra_day/bin/__init__.py +0 -0
- zebra_day/bin/fetch_zebra_config.py +15 -0
- zebra_day/bin/generate_coord_grid_zpl.py +50 -0
- zebra_day/bin/print_zpl_from_file.py +21 -0
- zebra_day/bin/probe_new_label_dimensions.py +75 -0
- zebra_day/bin/scan_for_networed_zebra_printers_arp_scan.sh +1 -0
- zebra_day/bin/scan_for_networed_zebra_printers_curl.sh +30 -0
- zebra_day/bin/zserve.py +701 -259
- zebra_day/cli/__init__.py +240 -0
- zebra_day/cli/cognito.py +121 -0
- zebra_day/cli/gui.py +255 -0
- zebra_day/cli/printer.py +168 -0
- zebra_day/cli/template.py +176 -0
- zebra_day/cmd_mgr.py +35 -0
- zebra_day/etc/Monoid-Regular-HalfTight-Dollar-0-1-l.ttf +0 -0
- zebra_day/etc/label_styles/blank.zpl +0 -0
- zebra_day/etc/label_styles/cornersStripOf4Squares_1inX1in.zpl +55 -0
- zebra_day/etc/label_styles/corners_1inX2in.zpl +28 -0
- zebra_day/etc/label_styles/corners_20cmX30cm.zpl +6 -0
- zebra_day/etc/label_styles/corners_smallTube.zpl +7 -0
- zebra_day/etc/label_styles/corners_unspecifiedDimensions.zpl +15 -0
- zebra_day/etc/label_styles/generic_2inX1in.zpl +21 -0
- zebra_day/etc/label_styles/plate_1inX0.25in.zpl +9 -0
- zebra_day/etc/label_styles/plate_1inX0.25inHD.zpl +9 -0
- zebra_day/etc/label_styles/smallTubeWdotHD_prod.zpl +8 -0
- zebra_day/etc/label_styles/smallTubeWdot_corners.zpl +7 -0
- zebra_day/etc/label_styles/smallTubeWdot_prod.zpl +8 -0
- zebra_day/etc/label_styles/smallTubeWdot_prodAlt1.zpl +6 -0
- zebra_day/etc/label_styles/smallTubeWdot_prodAlt1b.zpl +3 -0
- zebra_day/etc/label_styles/smallTubeWdot_prodV2.zpl +8 -0
- zebra_day/etc/label_styles/smallTubeWdot_reagent.zpl +29 -0
- zebra_day/etc/label_styles/stripOf4Squares_1inX1in.zpl +32 -0
- zebra_day/etc/label_styles/test_800dX800dCoordinateArray.zpl +1 -0
- zebra_day/etc/label_styles/tmps/.hold +0 -0
- zebra_day/etc/label_styles/tmps/tmp_zpl_templates.here +0 -0
- zebra_day/etc/label_styles/tube_20mmX30mmA.zpl +7 -0
- zebra_day/etc/label_styles/tube_2inX0.3in.zpl +15 -0
- zebra_day/etc/label_styles/tube_2inX0.5in.zpl +15 -0
- zebra_day/etc/label_styles/tube_2inX0.5inHD.zpl +15 -0
- zebra_day/etc/label_styles/tube_2inX1in.zpl +25 -0
- zebra_day/etc/label_styles/tube_2inX1inHD.zpl +22 -0
- zebra_day/etc/label_styles/tube_2inX1inHDv3.zpl +21 -0
- zebra_day/etc/old_printer_config/.hold +0 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.022846_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.033657_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.039597_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.047295_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.055804_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:50:25.061337_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.073326_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.081950_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.088251_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.096501_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.104767_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.110364_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.118239_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.125950_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.349866_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.361085_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.558323_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:24.565756_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.739070_printer_config.json +16 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.753796_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.760201_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.768747_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.775312_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.782533_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.789287_printer_config.json +1 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.794230_printer_config.json +3 -0
- zebra_day/etc/old_printer_config/2026-02-01_01:51:29.800021_printer_config.json +5 -0
- zebra_day/etc/printer_config.json +16 -0
- zebra_day/etc/printer_config.template.json +16 -0
- zebra_day/etc/tmp_printers0.json +5 -0
- zebra_day/etc/tmp_printers374.json +5 -0
- zebra_day/etc/tmp_printers383.json +5 -0
- zebra_day/etc/tmp_printers450.json +5 -0
- zebra_day/etc/tmp_printers504.json +5 -0
- zebra_day/etc/tmp_printers608.json +5 -0
- zebra_day/etc/tmp_printers657.json +5 -0
- zebra_day/etc/tmp_printers838.json +5 -0
- zebra_day/etc/tmp_printers839.json +5 -0
- zebra_day/etc/tmp_printers933.json +5 -0
- zebra_day/etc/tmp_printers957.json +5 -0
- zebra_day/exceptions.py +88 -0
- zebra_day/files/.hold +0 -0
- zebra_day/files/hold +0 -0
- zebra_day/files/test_png_17696.png +0 -0
- zebra_day/files/test_png_23477.png +0 -0
- zebra_day/files/test_png_28157.png +0 -0
- zebra_day/files/test_png_35832.png +0 -0
- zebra_day/files/test_png_36400.png +0 -0
- zebra_day/files/test_png_40816.png +0 -0
- zebra_day/files/test_png_49564.png +0 -0
- zebra_day/files/test_png_53848.png +0 -0
- zebra_day/files/test_png_62542.png +0 -0
- zebra_day/files/test_png_91597.png +0 -0
- zebra_day/files/test_png_93633.png +0 -0
- zebra_day/files/tmpbjo3k7q1.png +0 -0
- zebra_day/files/tmpigtr4pwy.png +0 -0
- zebra_day/files/zpl_label_tube_2inX1in_2026-02-01_01:51:24.370964.png +0 -0
- zebra_day/logging_config.py +74 -0
- zebra_day/logs/.hold +0 -0
- zebra_day/logs/print_requests.log +2 -0
- zebra_day/paths.py +143 -0
- zebra_day/print_mgr.py +487 -103
- zebra_day/static/datschund.css +140 -0
- zebra_day/static/datschund.png +0 -0
- zebra_day/static/daylily.png +0 -0
- zebra_day/static/favicon.svg +20 -0
- zebra_day/static/general.css +99 -0
- zebra_day/static/js/zebra_modern.js +172 -0
- zebra_day/static/lsmc.css +354 -0
- zebra_day/static/moon.jpeg +0 -0
- zebra_day/static/oakland.css +197 -0
- zebra_day/static/petrichor.css +150 -0
- zebra_day/static/popday_daylily.css +140 -0
- zebra_day/static/style.css +183 -0
- zebra_day/static/triangles.css +122 -0
- zebra_day/static/tron.css +277 -0
- zebra_day/static/zebra_modern.css +771 -0
- zebra_day/static/zebras.css +176 -0
- zebra_day/templates/base.html +36 -0
- zebra_day/templates/bpr.html +72 -0
- zebra_day/templates/build_new_config.html +36 -0
- zebra_day/templates/build_print_request.html +32 -0
- zebra_day/templates/chg_ui_style.html +19 -0
- zebra_day/templates/edit_template.html +128 -0
- zebra_day/templates/edit_zpl.html +37 -0
- zebra_day/templates/index.html +82 -0
- zebra_day/templates/legacy/base.html +37 -0
- zebra_day/templates/legacy/bpr.html +72 -0
- zebra_day/templates/legacy/build_new_config.html +36 -0
- zebra_day/templates/legacy/build_print_request.html +32 -0
- zebra_day/templates/legacy/chg_ui_style.html +19 -0
- zebra_day/templates/legacy/edit_template.html +128 -0
- zebra_day/templates/legacy/edit_zpl.html +37 -0
- zebra_day/templates/legacy/index.html +82 -0
- zebra_day/templates/legacy/list_prior_configs.html +24 -0
- zebra_day/templates/legacy/print_result.html +30 -0
- zebra_day/templates/legacy/printer_details.html +25 -0
- zebra_day/templates/legacy/printer_status.html +70 -0
- zebra_day/templates/legacy/save_result.html +17 -0
- zebra_day/templates/legacy/send_print_request.html +34 -0
- zebra_day/templates/legacy/simple_print.html +94 -0
- zebra_day/templates/legacy/view_pstation_json.html +29 -0
- zebra_day/templates/list_prior_configs.html +24 -0
- zebra_day/templates/modern/base.html +98 -0
- zebra_day/templates/modern/config.html +141 -0
- zebra_day/templates/modern/dashboard.html +160 -0
- zebra_day/templates/modern/print_request.html +141 -0
- zebra_day/templates/modern/print_result.html +88 -0
- zebra_day/templates/modern/printer_detail.html +117 -0
- zebra_day/templates/modern/printers.html +133 -0
- zebra_day/templates/modern/save_result.html +46 -0
- zebra_day/templates/modern/template_editor.html +172 -0
- zebra_day/templates/modern/templates.html +122 -0
- zebra_day/templates/print_result.html +30 -0
- zebra_day/templates/printer_details.html +25 -0
- zebra_day/templates/printer_status.html +70 -0
- zebra_day/templates/save_result.html +17 -0
- zebra_day/templates/send_print_request.html +34 -0
- zebra_day/templates/simple_print.html +94 -0
- zebra_day/templates/view_pstation_json.html +29 -0
- zebra_day/web/__init__.py +9 -0
- zebra_day/web/app.py +171 -0
- zebra_day/web/auth.py +172 -0
- zebra_day/web/middleware.py +159 -0
- zebra_day/web/routers/__init__.py +2 -0
- zebra_day/web/routers/api.py +163 -0
- zebra_day/web/routers/ui.py +1051 -0
- zebra_day/zpl_renderer.py +273 -0
- zebra_day-1.0.2.dist-info/METADATA +786 -0
- zebra_day-1.0.2.dist-info/RECORD +179 -0
- {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info}/WHEEL +1 -1
- zebra_day-1.0.2.dist-info/entry_points.txt +4 -0
- zebra_day/bin/te.py +0 -905
- zebra_day-0.0.37.dist-info/METADATA +0 -1177
- zebra_day-0.0.37.dist-info/RECORD +0 -10
- {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info/licenses}/LICENSE +0 -0
- {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info}/top_level.txt +0 -0
zebra_day/paths.py
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""
|
|
2
|
+
XDG Base Directory specification support for zebra_day.
|
|
3
|
+
|
|
4
|
+
This module provides cross-platform paths for configuration, state, cache, and data
|
|
5
|
+
following the XDG Base Directory specification on Linux/macOS.
|
|
6
|
+
|
|
7
|
+
XDG Base Directory Specification:
|
|
8
|
+
- XDG_CONFIG_HOME: User configuration files (~/.config)
|
|
9
|
+
- XDG_DATA_HOME: User data files (~/.local/share)
|
|
10
|
+
- XDG_STATE_HOME: User state files (~/.local/state) - logs, history
|
|
11
|
+
- XDG_CACHE_HOME: User cache files (~/.cache)
|
|
12
|
+
|
|
13
|
+
On macOS, we use ~/Library/Application Support for data and
|
|
14
|
+
~/Library/Preferences for config, but support XDG overrides.
|
|
15
|
+
"""
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import os
|
|
19
|
+
import sys
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
from typing import Optional
|
|
22
|
+
|
|
23
|
+
APP_NAME = "zebra_day"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _get_xdg_dir(env_var: str, fallback: Path) -> Path:
|
|
27
|
+
"""Get XDG directory, respecting environment variable if set."""
|
|
28
|
+
env_value = os.environ.get(env_var)
|
|
29
|
+
if env_value:
|
|
30
|
+
return Path(env_value)
|
|
31
|
+
return fallback
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def get_config_dir() -> Path:
|
|
35
|
+
"""Get the configuration directory.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
Path to zebra_day config directory (created if needed)
|
|
39
|
+
"""
|
|
40
|
+
if sys.platform == "darwin":
|
|
41
|
+
# macOS: Use XDG if set, otherwise ~/Library/Preferences
|
|
42
|
+
fallback = Path.home() / "Library" / "Preferences" / APP_NAME
|
|
43
|
+
else:
|
|
44
|
+
# Linux/other: Use XDG
|
|
45
|
+
fallback = Path.home() / ".config" / APP_NAME
|
|
46
|
+
|
|
47
|
+
base = _get_xdg_dir("XDG_CONFIG_HOME", fallback.parent)
|
|
48
|
+
config_dir = base / APP_NAME if "XDG_CONFIG_HOME" in os.environ else fallback
|
|
49
|
+
config_dir.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
return config_dir
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def get_data_dir() -> Path:
|
|
54
|
+
"""Get the data directory for persistent application data.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Path to zebra_day data directory (created if needed)
|
|
58
|
+
"""
|
|
59
|
+
if sys.platform == "darwin":
|
|
60
|
+
fallback = Path.home() / "Library" / "Application Support" / APP_NAME
|
|
61
|
+
else:
|
|
62
|
+
fallback = Path.home() / ".local" / "share" / APP_NAME
|
|
63
|
+
|
|
64
|
+
base = _get_xdg_dir("XDG_DATA_HOME", fallback.parent)
|
|
65
|
+
data_dir = base / APP_NAME if "XDG_DATA_HOME" in os.environ else fallback
|
|
66
|
+
data_dir.mkdir(parents=True, exist_ok=True)
|
|
67
|
+
return data_dir
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def get_state_dir() -> Path:
|
|
71
|
+
"""Get the state directory for logs and runtime state.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Path to zebra_day state directory (created if needed)
|
|
75
|
+
"""
|
|
76
|
+
if sys.platform == "darwin":
|
|
77
|
+
fallback = Path.home() / "Library" / "Logs" / APP_NAME
|
|
78
|
+
else:
|
|
79
|
+
fallback = Path.home() / ".local" / "state" / APP_NAME
|
|
80
|
+
|
|
81
|
+
base = _get_xdg_dir("XDG_STATE_HOME", fallback.parent)
|
|
82
|
+
state_dir = base / APP_NAME if "XDG_STATE_HOME" in os.environ else fallback
|
|
83
|
+
state_dir.mkdir(parents=True, exist_ok=True)
|
|
84
|
+
return state_dir
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def get_cache_dir() -> Path:
|
|
88
|
+
"""Get the cache directory for temporary files.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Path to zebra_day cache directory (created if needed)
|
|
92
|
+
"""
|
|
93
|
+
if sys.platform == "darwin":
|
|
94
|
+
fallback = Path.home() / "Library" / "Caches" / APP_NAME
|
|
95
|
+
else:
|
|
96
|
+
fallback = Path.home() / ".cache" / APP_NAME
|
|
97
|
+
|
|
98
|
+
base = _get_xdg_dir("XDG_CACHE_HOME", fallback.parent)
|
|
99
|
+
cache_dir = base / APP_NAME if "XDG_CACHE_HOME" in os.environ else fallback
|
|
100
|
+
cache_dir.mkdir(parents=True, exist_ok=True)
|
|
101
|
+
return cache_dir
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# Specific file/directory paths
|
|
105
|
+
def get_printer_config_path() -> Path:
|
|
106
|
+
"""Get path to the printer configuration JSON file."""
|
|
107
|
+
return get_config_dir() / "printer_config.json"
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def get_label_styles_dir() -> Path:
|
|
111
|
+
"""Get path to the label styles directory."""
|
|
112
|
+
styles_dir = get_data_dir() / "label_styles"
|
|
113
|
+
styles_dir.mkdir(parents=True, exist_ok=True)
|
|
114
|
+
return styles_dir
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def get_label_drafts_dir() -> Path:
|
|
118
|
+
"""Get path to the label drafts (tmps) directory."""
|
|
119
|
+
drafts_dir = get_label_styles_dir() / "tmps"
|
|
120
|
+
drafts_dir.mkdir(parents=True, exist_ok=True)
|
|
121
|
+
return drafts_dir
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def get_config_backups_dir() -> Path:
|
|
125
|
+
"""Get path to the config backups directory."""
|
|
126
|
+
backups_dir = get_config_dir() / "backups"
|
|
127
|
+
backups_dir.mkdir(parents=True, exist_ok=True)
|
|
128
|
+
return backups_dir
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def get_logs_dir() -> Path:
|
|
132
|
+
"""Get path to the logs directory."""
|
|
133
|
+
logs_dir = get_state_dir() / "logs"
|
|
134
|
+
logs_dir.mkdir(parents=True, exist_ok=True)
|
|
135
|
+
return logs_dir
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def get_generated_files_dir() -> Path:
|
|
139
|
+
"""Get path for generated files like PNGs."""
|
|
140
|
+
files_dir = get_cache_dir() / "generated"
|
|
141
|
+
files_dir.mkdir(parents=True, exist_ok=True)
|
|
142
|
+
return files_dir
|
|
143
|
+
|