ulpp 1.3.1__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.
Files changed (80) hide show
  1. ulpp/__init__.py +10 -0
  2. ulpp/__main__.py +52 -0
  3. ulpp/assets/light/560/tray_f00.png +0 -0
  4. ulpp/assets/light/560/tray_f01.png +0 -0
  5. ulpp/assets/light/560/tray_f02.png +0 -0
  6. ulpp/assets/light/560/tray_f03.png +0 -0
  7. ulpp/assets/light/560/tray_f04.png +0 -0
  8. ulpp/assets/light/560/tray_f05.png +0 -0
  9. ulpp/assets/light/560/tray_f06.png +0 -0
  10. ulpp/assets/light/560/tray_f07.png +0 -0
  11. ulpp/assets/light/560/tray_f08.png +0 -0
  12. ulpp/assets/light/560/tray_f09.png +0 -0
  13. ulpp/assets/light/560/tray_f10.png +0 -0
  14. ulpp/assets/light/560/tray_f11.png +0 -0
  15. ulpp/assets/light/560/tray_hold.png +0 -0
  16. ulpp/assets/light/560/tray_plain.png +0 -0
  17. ulpp/assets/light/980/tray_f00.png +0 -0
  18. ulpp/assets/light/980/tray_f01.png +0 -0
  19. ulpp/assets/light/980/tray_f02.png +0 -0
  20. ulpp/assets/light/980/tray_f03.png +0 -0
  21. ulpp/assets/light/980/tray_f04.png +0 -0
  22. ulpp/assets/light/980/tray_f05.png +0 -0
  23. ulpp/assets/light/980/tray_f06.png +0 -0
  24. ulpp/assets/light/980/tray_f07.png +0 -0
  25. ulpp/assets/light/980/tray_f08.png +0 -0
  26. ulpp/assets/light/980/tray_f09.png +0 -0
  27. ulpp/assets/light/980/tray_f10.png +0 -0
  28. ulpp/assets/light/980/tray_f11.png +0 -0
  29. ulpp/assets/light/980/tray_hold.png +0 -0
  30. ulpp/assets/light/980/tray_plain.png +0 -0
  31. ulpp/assets/mono/560/tray_f00.png +0 -0
  32. ulpp/assets/mono/560/tray_f01.png +0 -0
  33. ulpp/assets/mono/560/tray_f02.png +0 -0
  34. ulpp/assets/mono/560/tray_f03.png +0 -0
  35. ulpp/assets/mono/560/tray_f04.png +0 -0
  36. ulpp/assets/mono/560/tray_f05.png +0 -0
  37. ulpp/assets/mono/560/tray_f06.png +0 -0
  38. ulpp/assets/mono/560/tray_f07.png +0 -0
  39. ulpp/assets/mono/560/tray_f08.png +0 -0
  40. ulpp/assets/mono/560/tray_f09.png +0 -0
  41. ulpp/assets/mono/560/tray_f10.png +0 -0
  42. ulpp/assets/mono/560/tray_f11.png +0 -0
  43. ulpp/assets/mono/560/tray_hold.png +0 -0
  44. ulpp/assets/mono/560/tray_plain.png +0 -0
  45. ulpp/assets/mono/980/tray_f00.png +0 -0
  46. ulpp/assets/mono/980/tray_f01.png +0 -0
  47. ulpp/assets/mono/980/tray_f02.png +0 -0
  48. ulpp/assets/mono/980/tray_f03.png +0 -0
  49. ulpp/assets/mono/980/tray_f04.png +0 -0
  50. ulpp/assets/mono/980/tray_f05.png +0 -0
  51. ulpp/assets/mono/980/tray_f06.png +0 -0
  52. ulpp/assets/mono/980/tray_f07.png +0 -0
  53. ulpp/assets/mono/980/tray_f08.png +0 -0
  54. ulpp/assets/mono/980/tray_f09.png +0 -0
  55. ulpp/assets/mono/980/tray_f10.png +0 -0
  56. ulpp/assets/mono/980/tray_f11.png +0 -0
  57. ulpp/assets/mono/980/tray_hold.png +0 -0
  58. ulpp/assets/mono/980/tray_plain.png +0 -0
  59. ulpp/assets/testpage.pg +0 -0
  60. ulpp/builder.py +581 -0
  61. ulpp/calibration.py +215 -0
  62. ulpp/cli.py +263 -0
  63. ulpp/config.py +74 -0
  64. ulpp/gui.py +460 -0
  65. ulpp/i18n.py +192 -0
  66. ulpp/imagex.py +51 -0
  67. ulpp/locales/en_US.json +246 -0
  68. ulpp/locales/zh_CN.json +246 -0
  69. ulpp/parser.py +373 -0
  70. ulpp/partial_gui.py +837 -0
  71. ulpp/presets.py +122 -0
  72. ulpp/sheets.py +363 -0
  73. ulpp/textlabel.py +220 -0
  74. ulpp/wizard.py +647 -0
  75. ulpp-1.3.1.dist-info/METADATA +314 -0
  76. ulpp-1.3.1.dist-info/RECORD +80 -0
  77. ulpp-1.3.1.dist-info/WHEEL +5 -0
  78. ulpp-1.3.1.dist-info/entry_points.txt +2 -0
  79. ulpp-1.3.1.dist-info/licenses/LICENSE +21 -0
  80. ulpp-1.3.1.dist-info/top_level.txt +1 -0
ulpp/__init__.py ADDED
@@ -0,0 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+ """通用标签打印平台:把 PDF 里的卡片或一段文字自动排成 A4 不干胶标签。"""
3
+
4
+ __version__ = "1.3.1"
5
+ __all__ = ["__version__"]
6
+
7
+ # 兼容旧代码的常量;界面显示名走 i18n.tr("app.name")
8
+ APP_NAME = "通用标签打印平台"
9
+ APP_NAME_EN = "Universal Label Printing Platform"
10
+
ulpp/__main__.py ADDED
@@ -0,0 +1,52 @@
1
+ # -*- coding: utf-8 -*-
2
+ """python -m ulpp:无参数(或只给 --lang)时开图形界面,其余参数走命令行。"""
3
+
4
+ import sys
5
+ from typing import Optional, Tuple
6
+
7
+
8
+ def _parse_gui_args(argv) -> Tuple[bool, Optional[str]]:
9
+ """判断参数是否“只指定了语言”。是则返回 (True, lang),否则 (False, None)。"""
10
+ lang: Optional[str] = None
11
+ i = 0
12
+ while i < len(argv):
13
+ arg = argv[i]
14
+ if arg == "--lang":
15
+ if i + 1 >= len(argv) or argv[i + 1].startswith("-"):
16
+ return False, None
17
+ lang = argv[i + 1]
18
+ i += 2
19
+ elif arg.startswith("--lang="):
20
+ lang = arg.split("=", 1)[1]
21
+ i += 1
22
+ else:
23
+ return False, None
24
+ return True, lang
25
+
26
+
27
+ def main() -> int:
28
+ from .i18n import set_language
29
+
30
+ argv = sys.argv[1:]
31
+ if not argv:
32
+ set_language(None)
33
+ from .gui import main as gui_main
34
+
35
+ gui_main()
36
+ return 0
37
+
38
+ gui_only, lang = _parse_gui_args(argv)
39
+ if gui_only:
40
+ set_language(lang)
41
+ from .gui import main as gui_main
42
+
43
+ gui_main()
44
+ return 0
45
+
46
+ from .cli import main as cli_main
47
+
48
+ return cli_main(argv)
49
+
50
+
51
+ if __name__ == "__main__":
52
+ raise SystemExit(main())
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file