edof 4.2.3__tar.gz → 4.2.4__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.
Files changed (89) hide show
  1. {edof-4.2.3 → edof-4.2.4}/PKG-INFO +1 -1
  2. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/__init__.py +18 -0
  3. {edof-4.2.3 → edof-4.2.4}/edof/_apps/editor.py +14 -0
  4. {edof-4.2.3 → edof-4.2.4}/edof/_apps/file_assoc.py +34 -19
  5. {edof-4.2.3 → edof-4.2.4}/edof/_apps/viewer.py +14 -0
  6. {edof-4.2.3 → edof-4.2.4}/edof/version.py +1 -1
  7. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/PKG-INFO +1 -1
  8. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/entry_points.txt +2 -0
  9. {edof-4.2.3 → edof-4.2.4}/pyproject.toml +4 -2
  10. {edof-4.2.3 → edof-4.2.4}/LICENSE +0 -0
  11. {edof-4.2.3 → edof-4.2.4}/README.md +0 -0
  12. {edof-4.2.3 → edof-4.2.4}/edof/__init__.py +0 -0
  13. {edof-4.2.3 → edof-4.2.4}/edof/_apps/__init__.py +0 -0
  14. {edof-4.2.3 → edof-4.2.4}/edof/_apps/_assoc_dialog.py +0 -0
  15. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/__init__.py +0 -0
  16. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-document-512.png +0 -0
  17. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-document.icns +0 -0
  18. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-document.ico +0 -0
  19. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-document.png +0 -0
  20. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-editor-512.png +0 -0
  21. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-editor.icns +0 -0
  22. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-editor.ico +0 -0
  23. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-editor.png +0 -0
  24. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-viewer-512.png +0 -0
  25. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-viewer.icns +0 -0
  26. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-viewer.ico +0 -0
  27. {edof-4.2.3 → edof-4.2.4}/edof/_apps/assets/icons/edof-viewer.png +0 -0
  28. {edof-4.2.3 → edof-4.2.4}/edof/_apps/cli.py +0 -0
  29. {edof-4.2.3 → edof-4.2.4}/edof/_apps/edof_text_editor.py +0 -0
  30. {edof-4.2.3 → edof-4.2.4}/edof/_apps/shortcuts.py +0 -0
  31. {edof-4.2.3 → edof-4.2.4}/edof/api/__init__.py +0 -0
  32. {edof-4.2.3 → edof-4.2.4}/edof/api/commands.py +0 -0
  33. {edof-4.2.3 → edof-4.2.4}/edof/crypto/__init__.py +0 -0
  34. {edof-4.2.3 → edof-4.2.4}/edof/crypto/document_protection.py +0 -0
  35. {edof-4.2.3 → edof-4.2.4}/edof/crypto/encryption.py +0 -0
  36. {edof-4.2.3 → edof-4.2.4}/edof/crypto/permissions.py +0 -0
  37. {edof-4.2.3 → edof-4.2.4}/edof/editor_lang/en.json +0 -0
  38. {edof-4.2.3 → edof-4.2.4}/edof/engine/__init__.py +0 -0
  39. {edof-4.2.3 → edof-4.2.4}/edof/engine/color.py +0 -0
  40. {edof-4.2.3 → edof-4.2.4}/edof/engine/debug_log.py +0 -0
  41. {edof-4.2.3 → edof-4.2.4}/edof/engine/document_flow.py +0 -0
  42. {edof-4.2.3 → edof-4.2.4}/edof/engine/document_paginate.py +0 -0
  43. {edof-4.2.3 → edof-4.2.4}/edof/engine/renderer.py +0 -0
  44. {edof-4.2.3 → edof-4.2.4}/edof/engine/text_engine.py +0 -0
  45. {edof-4.2.3 → edof-4.2.4}/edof/engine/text_layout.py +0 -0
  46. {edof-4.2.3 → edof-4.2.4}/edof/engine/textbox_flow.py +0 -0
  47. {edof-4.2.3 → edof-4.2.4}/edof/engine/transform.py +0 -0
  48. {edof-4.2.3 → edof-4.2.4}/edof/exceptions.py +0 -0
  49. {edof-4.2.3 → edof-4.2.4}/edof/export/__init__.py +0 -0
  50. {edof-4.2.3 → edof-4.2.4}/edof/export/bitmap.py +0 -0
  51. {edof-4.2.3 → edof-4.2.4}/edof/export/legacy_v3.py +0 -0
  52. {edof-4.2.3 → edof-4.2.4}/edof/export/pdf.py +0 -0
  53. {edof-4.2.3 → edof-4.2.4}/edof/export/pdf_writer.py +0 -0
  54. {edof-4.2.3 → edof-4.2.4}/edof/export/printer.py +0 -0
  55. {edof-4.2.3 → edof-4.2.4}/edof/export/svg.py +0 -0
  56. {edof-4.2.3 → edof-4.2.4}/edof/format/__init__.py +0 -0
  57. {edof-4.2.3 → edof-4.2.4}/edof/format/document.py +0 -0
  58. {edof-4.2.3 → edof-4.2.4}/edof/format/document_body.py +0 -0
  59. {edof-4.2.3 → edof-4.2.4}/edof/format/document_boxes.py +0 -0
  60. {edof-4.2.3 → edof-4.2.4}/edof/format/objects.py +0 -0
  61. {edof-4.2.3 → edof-4.2.4}/edof/format/serializer.py +0 -0
  62. {edof-4.2.3 → edof-4.2.4}/edof/format/styles.py +0 -0
  63. {edof-4.2.3 → edof-4.2.4}/edof/format/svg_io.py +0 -0
  64. {edof-4.2.3 → edof-4.2.4}/edof/format/variables.py +0 -0
  65. {edof-4.2.3 → edof-4.2.4}/edof/gui/__init__.py +0 -0
  66. {edof-4.2.3 → edof-4.2.4}/edof/gui/pyqt6_widget.py +0 -0
  67. {edof-4.2.3 → edof-4.2.4}/edof/gui/tkinter_canvas.py +0 -0
  68. {edof-4.2.3 → edof-4.2.4}/edof/interop/__init__.py +0 -0
  69. {edof-4.2.3 → edof-4.2.4}/edof/interop/docx_io.py +0 -0
  70. {edof-4.2.3 → edof-4.2.4}/edof/py.typed +0 -0
  71. {edof-4.2.3 → edof-4.2.4}/edof/units.py +0 -0
  72. {edof-4.2.3 → edof-4.2.4}/edof/utils/__init__.py +0 -0
  73. {edof-4.2.3 → edof-4.2.4}/edof/utils/compat.py +0 -0
  74. {edof-4.2.3 → edof-4.2.4}/edof/utils/legacy_v2.py +0 -0
  75. {edof-4.2.3 → edof-4.2.4}/edof/utils/pdf_import.py +0 -0
  76. {edof-4.2.3 → edof-4.2.4}/edof/utils/qr.py +0 -0
  77. {edof-4.2.3 → edof-4.2.4}/edof/utils/rtf.py +0 -0
  78. {edof-4.2.3 → edof-4.2.4}/edof/utils/safe_eval.py +0 -0
  79. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/SOURCES.txt +0 -0
  80. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/dependency_links.txt +0 -0
  81. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/requires.txt +0 -0
  82. {edof-4.2.3 → edof-4.2.4}/edof.egg-info/top_level.txt +0 -0
  83. {edof-4.2.3 → edof-4.2.4}/setup.cfg +0 -0
  84. {edof-4.2.3 → edof-4.2.4}/tests/test_v310.py +0 -0
  85. {edof-4.2.3 → edof-4.2.4}/tests/test_v400.py +0 -0
  86. {edof-4.2.3 → edof-4.2.4}/tests/test_v401.py +0 -0
  87. {edof-4.2.3 → edof-4.2.4}/tests/test_v402.py +0 -0
  88. {edof-4.2.3 → edof-4.2.4}/tests/test_v403.py +0 -0
  89. {edof-4.2.3 → edof-4.2.4}/tests/test_v410.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edof
3
- Version: 4.2.3
3
+ Version: 4.2.4
4
4
  Summary: Easy Document Format – programmatic document creation, editing and export with vector PDF, rich text, tables and PDF import
5
5
  License: MIT License
6
6
 
@@ -32,3 +32,21 @@ def app_icon_name(kind: str, ext: str = "ico") -> str:
32
32
  """Map a logical kind to an icon file name. kind in {editor,viewer,document}."""
33
33
  kind = kind if kind in ("editor", "viewer", "document") else "document"
34
34
  return f"edof-{kind}.{ext}"
35
+
36
+
37
+ def set_windows_app_id(app_id: str) -> None:
38
+ """Give this process its own Windows taskbar identity.
39
+
40
+ Without this, a GUI launched under python/pythonw is grouped under the host
41
+ interpreter and the taskbar shows the interpreter's icon instead of the
42
+ app's window icon. Must be called early, before any window is shown. No-op
43
+ off Windows.
44
+ """
45
+ import sys
46
+ if sys.platform != "win32":
47
+ return
48
+ try:
49
+ import ctypes
50
+ ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(str(app_id))
51
+ except Exception:
52
+ pass
@@ -12280,6 +12280,13 @@ def _tpl_invoice():
12280
12280
 
12281
12281
 
12282
12282
  def main():
12283
+ # v4.2.4: own taskbar identity so Windows shows the EDOF icon, not Python's.
12284
+ try:
12285
+ from edof._apps.assets import set_windows_app_id
12286
+ set_windows_app_id("DavidSchobl.EDOF.Editor")
12287
+ except Exception:
12288
+ pass
12289
+
12283
12290
  # Remove Qt image allocation limit (default 256 MB blocks large print jobs)
12284
12291
  try:
12285
12292
  from PyQt6.QtGui import QImageReader
@@ -12321,6 +12328,13 @@ def main():
12321
12328
 
12322
12329
  app=QApplication(sys.argv); app.setApplicationName("EDOF Editor")
12323
12330
  app.setApplicationVersion(edof.__version__)
12331
+ try:
12332
+ from edof._apps.assets import icon_path
12333
+ _ip = icon_path("edof-editor.ico") or icon_path("edof-editor.png")
12334
+ if _ip:
12335
+ app.setWindowIcon(QIcon(_ip))
12336
+ except Exception:
12337
+ pass
12324
12338
  try:
12325
12339
  win=EdofEditor(sys.argv[1] if len(sys.argv)>1 else None)
12326
12340
  win.show()
@@ -17,31 +17,46 @@ import subprocess
17
17
  from pathlib import Path
18
18
 
19
19
 
20
- def _find_viewer_executable():
21
- """Locate the edof-viewer command in PATH."""
22
- exe = shutil.which("edof-viewer")
23
- if exe:
24
- return exe
25
- # Fallback: try Python module invocation
20
+ def _find_app_executable(cmd_name: str, module: str) -> str:
21
+ """Locate a GUI launcher as an ABSOLUTE path, never a .bat/.cmd.
22
+
23
+ Order: (1) the generated exe next to the interpreter (Scripts/ for pip
24
+ installs), (2) PATH via shutil.which but rejecting .bat/.cmd and forced to
25
+ absolute, (3) fall back to running the module with the interpreter
26
+ (pythonw on Windows so no console appears). This avoids picking up a
27
+ launcher .bat from the current directory, which has no icon and breaks when
28
+ invoked with a relative path.
29
+ """
30
+ exe_dir = os.path.dirname(os.path.abspath(sys.executable)) if sys.executable else ""
31
+ names = [cmd_name + ".exe", cmd_name] if os.name == "nt" else [cmd_name]
32
+ for d in ([os.path.join(exe_dir, "Scripts"), exe_dir] if exe_dir else []):
33
+ for n in names:
34
+ p = os.path.join(d, n)
35
+ if os.path.isfile(p) and not p.lower().endswith((".bat", ".cmd")):
36
+ return os.path.abspath(p)
37
+ found = shutil.which(cmd_name)
38
+ if found and not found.lower().endswith((".bat", ".cmd")):
39
+ return os.path.abspath(found)
26
40
  if sys.executable:
27
- return f'"{sys.executable}" -m edof._apps.viewer'
41
+ py = os.path.abspath(sys.executable)
42
+ if os.name == "nt":
43
+ pyw = os.path.join(os.path.dirname(py), "pythonw.exe")
44
+ if os.path.isfile(pyw):
45
+ py = pyw
46
+ return f'"{py}" -m {module}'
28
47
  raise RuntimeError(
29
- "Could not locate edof-viewer executable. "
30
- "Make sure edof[viewer] is installed: pip install 'edof[viewer]'"
48
+ f"Could not locate {cmd_name}. Install with: pip install 'edof[all]'"
31
49
  )
32
50
 
33
51
 
52
+ def _find_viewer_executable():
53
+ """Locate the edof-viewer launcher (absolute path, never a .bat)."""
54
+ return _find_app_executable("edof-viewer", "edof._apps.viewer")
55
+
56
+
34
57
  def _find_editor_executable():
35
- """Locate the edof-editor command in PATH (fallback to module invocation)."""
36
- exe = shutil.which("edof-editor")
37
- if exe:
38
- return exe
39
- if sys.executable:
40
- return f'"{sys.executable}" -m edof._apps.editor'
41
- raise RuntimeError(
42
- "Could not locate edof-editor executable. "
43
- "Make sure edof[editor] is installed: pip install 'edof[all]'"
44
- )
58
+ """Locate the edof-editor launcher (absolute path, never a .bat)."""
59
+ return _find_app_executable("edof-editor", "edof._apps.editor")
45
60
 
46
61
 
47
62
  def _cmd_with_arg(exe: str) -> str:
@@ -581,9 +581,23 @@ def main():
581
581
  print("Install with: pip install edof[viewer]")
582
582
  sys.exit(1)
583
583
 
584
+ # v4.2.4: own taskbar identity so Windows shows the EDOF icon, not Python's.
585
+ try:
586
+ from edof._apps.assets import set_windows_app_id
587
+ set_windows_app_id("DavidSchobl.EDOF.Viewer")
588
+ except Exception:
589
+ pass
590
+
584
591
  app = QApplication(sys.argv)
585
592
  app.setApplicationName("EDOF Viewer")
586
593
  app.setApplicationVersion(edof.__version__)
594
+ try:
595
+ from edof._apps.assets import icon_path
596
+ _ip = icon_path("edof-viewer.ico") or icon_path("edof-viewer.png")
597
+ if _ip:
598
+ app.setWindowIcon(QIcon(_ip))
599
+ except Exception:
600
+ pass
587
601
 
588
602
  # Optional file argument
589
603
  filepath = None
@@ -9,7 +9,7 @@ typography values in pt and are migrated on load.
9
9
  """
10
10
 
11
11
  from __future__ import annotations
12
- __version__ = "4.2.3"
12
+ __version__ = "4.2.4"
13
13
  FORMAT_MAJOR = 4
14
14
  FORMAT_MINOR = 2
15
15
  FORMAT_PATCH = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edof
3
- Version: 4.2.3
3
+ Version: 4.2.4
4
4
  Summary: Easy Document Format – programmatic document creation, editing and export with vector PDF, rich text, tables and PDF import
5
5
  License: MIT License
6
6
 
@@ -1,4 +1,6 @@
1
1
  [console_scripts]
2
2
  edof-cli = edof._apps.cli:main
3
+
4
+ [gui_scripts]
3
5
  edof-editor = edof._apps.editor:main
4
6
  edof-viewer = edof._apps.viewer:main
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "edof"
7
- version = "4.2.3"
7
+ version = "4.2.4"
8
8
  description = "Easy Document Format – programmatic document creation, editing and export with vector PDF, rich text, tables and PDF import"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -89,6 +89,8 @@ addopts = "-v --tb=short"
89
89
  source = ["edof"]
90
90
 
91
91
  [project.scripts]
92
+ edof-cli = "edof._apps.cli:main"
93
+
94
+ [project.gui-scripts]
92
95
  edof-editor = "edof._apps.editor:main"
93
96
  edof-viewer = "edof._apps.viewer:main"
94
- edof-cli = "edof._apps.cli:main"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes