drawio-python 0.1.4__tar.gz → 0.1.5__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.
- {drawio_python-0.1.4 → drawio_python-0.1.5}/PKG-INFO +1 -1
- drawio_python-0.1.5/drawio/VERSION +1 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/render/desktop.py +18 -3
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/PKG-INFO +1 -1
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_lint_render.py +9 -0
- drawio_python-0.1.4/drawio/VERSION +0 -1
- {drawio_python-0.1.4 → drawio_python-0.1.5}/Containerfile +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/HISTORY.md +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/LICENSE +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/MANIFEST.in +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/README.md +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/docs/index.md +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/__main__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/base.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/cli.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/controllers/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/doctor.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/document.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/base_entity.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/config.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_app.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_browser.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/abstract_config.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/connect_config.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/drawio_config.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/label_config.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/erd/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/erd/column.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/erd/erd.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/erd/table.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/graph/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/graph/edge.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/graph/graph.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/graph/node.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/logger.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/renderers/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/renderers/base_render.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/renderers/drawio_render.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/renderers/pdf_render.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/itergrations/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/itergrations/mermaid/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/itergrations/mermaid/mermaid_controller.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/layout.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/lint.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/render/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/render/browser.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/render/fonts.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/render/native.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/scene.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/shapes.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/skill/SKILL.md +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/skill/references/api.md +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/skill.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/text.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/SOURCES.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/dependency_links.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/entry_points.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/requires.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/drawio_python.egg-info/top_level.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/agent_workflow.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/complex-example.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/draw-flow-diagrams.png +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/draw-flow-diagrams.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/mermaid-to-drawio.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/examples/native_document.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/mkdocs.yml +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/pyproject.toml +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/requirements-test.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/requirements.txt +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/setup.cfg +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/setup.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/__init__.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/conftest.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_base.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_cli.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_document.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_examples.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_graph.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_graph_native.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_imports.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_layout_text.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_mermaid.py +0 -0
- {drawio_python-0.1.4 → drawio_python-0.1.5}/tests/test_toolkit_api.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.5
|
|
@@ -12,6 +12,7 @@ import os
|
|
|
12
12
|
import shutil
|
|
13
13
|
import subprocess
|
|
14
14
|
import sys
|
|
15
|
+
import sysconfig
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import Optional
|
|
17
18
|
|
|
@@ -34,13 +35,27 @@ _CANDIDATES = {
|
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
def _is_ours(path: str) -> bool:
|
|
37
|
-
"""
|
|
38
|
+
"""Whether `path` is the `drawio` command of a Python package rather than draw.io desktop.
|
|
39
|
+
|
|
40
|
+
pip installs that command as a script with a Python shebang on Linux and macOS, and as
|
|
41
|
+
an .exe launcher with the script appended (uncompressed) on Windows. Anything inside a
|
|
42
|
+
Python scripts directory counts as ours too.
|
|
43
|
+
"""
|
|
44
|
+
resolved = Path(path).resolve()
|
|
45
|
+
scripts = {sysconfig.get_path("scripts"), str(Path(sys.executable).parent)}
|
|
46
|
+
if any(d and Path(d).resolve() == resolved.parent for d in scripts):
|
|
47
|
+
return True
|
|
38
48
|
try:
|
|
39
|
-
with open(
|
|
49
|
+
with open(resolved, "rb") as stream:
|
|
40
50
|
head = stream.read(256)
|
|
51
|
+
stream.seek(0, os.SEEK_END)
|
|
52
|
+
stream.seek(max(0, stream.tell() - 65536))
|
|
53
|
+
tail = stream.read()
|
|
41
54
|
except OSError:
|
|
42
55
|
return False
|
|
43
|
-
|
|
56
|
+
if head.startswith(b"#!") and b"python" in head.lower():
|
|
57
|
+
return True
|
|
58
|
+
return b"drawio.__main__" in tail or b"from drawio" in tail
|
|
44
59
|
|
|
45
60
|
|
|
46
61
|
def find() -> Optional[str]:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import xml.etree.ElementTree as ET
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
import pytest
|
|
4
5
|
|
|
@@ -150,6 +151,14 @@ def test_desktop_detection_and_command(tmp_path, monkeypatch):
|
|
|
150
151
|
script = tmp_path / "drawio"
|
|
151
152
|
script.write_text("#!/usr/bin/env python3\nprint('hi')\n")
|
|
152
153
|
assert desktop._is_ours(str(script))
|
|
154
|
+
launcher = tmp_path / "drawio.exe" # pip's Windows launcher: binary stub + appended script
|
|
155
|
+
launcher.write_bytes(
|
|
156
|
+
b"MZ\x90\x00" + b"\x00" * 4096 + b"PK\x03\x04import re\nfrom drawio.__main__ import main\n"
|
|
157
|
+
)
|
|
158
|
+
assert desktop._is_ours(str(launcher))
|
|
159
|
+
import sysconfig
|
|
160
|
+
|
|
161
|
+
assert desktop._is_ours(str(Path(sysconfig.get_path("scripts")) / "drawio"))
|
|
153
162
|
exe = tmp_path / "draw.io"
|
|
154
163
|
exe.write_bytes(b"\x7fELF")
|
|
155
164
|
monkeypatch.setenv("DRAWIO_DESKTOP", str(exe))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.1.4
|
|
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
|
{drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/entities/drawio_config/abstract_config.py
RENAMED
|
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
|
{drawio_python-0.1.4 → drawio_python-0.1.5}/drawio/itergrations/mermaid/mermaid_controller.py
RENAMED
|
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
|