pyDiffTools 0.1.23__tar.gz → 0.1.24__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.
- {pydifftools-0.1.23/pyDiffTools.egg-info → pydifftools-0.1.24}/PKG-INFO +1 -1
- {pydifftools-0.1.23 → pydifftools-0.1.24/pyDiffTools.egg-info}/PKG-INFO +1 -1
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/command_line.py +41 -1
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/flowchart/watch_graph.py +51 -12
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyproject.toml +1 -1
- {pydifftools-0.1.23 → pydifftools-0.1.24}/LICENSE.md +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/MANIFEST.in +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/README.rst +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/_quarto.yml +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/__version__.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/1a724af72b16f5a9e607e12b1c721645/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/1b28fc9daac9081847e5161b2c546f8a/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/231f64eee282fa225d1104935cf80a24/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/26e56f6b0ff54851a45145157f2f0dc4/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/311fabd7029ffd050d056e2f316eb50f/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/57da2021e5b156ac3adf01398201c723/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/62b24ea7da75011d92b0f8924faa208d/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/7f1b20d69d889514ab5d1cc92e3cb14f/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/86f74c8c54a87ff892d9b15dd714e8f0/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/88893b4234eac2945d9d6cb2e277f186/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/9a40046ada6f582ee34af00fbdbfb417/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/a1bf4d270d0641ff41faf1d7cce3439a/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/a3789f7d9585a781f2a1c60ce95ff10d/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/be46ecba858d39ad5f0c46902ddf1c02/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/d0cbc57a12f2ccce710a5afd04cc05e7/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/d3e12d320b14228f701231ae32ddd7dd/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/eb434f61555438d020a6970a5dbf9ee8/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/f6b0e73aa7fa029134665d4dde57e096/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/f719a6e4ff09873cb0ffb06ec9d232f9/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/executed/feeee244a7ce3d60e1a227eb604df823/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/global.db +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/example.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/example.tex +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/index.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/.jupyter_cache/__version__.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/.jupyter_cache/executed/ca90e4df5f4f0583df6554156a68dc7f/base.ipynb +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/.jupyter_cache/global.db +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/independent.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/index.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/tasks.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/test_include.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/tryforerror.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/test_include.qmd +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyDiffTools.egg-info/SOURCES.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyDiffTools.egg-info/dependency_links.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyDiffTools.egg-info/entry_points.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyDiffTools.egg-info/requires.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pyDiffTools.egg-info/top_level.txt +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/__init__.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/browser_lifecycle.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/check_numbers.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/command_registry.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/comment_functions.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/comment_tags.lua +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/comment_toggle.js +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/comments.css +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/continuous.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/copy_files.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/diff-doc.js +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/doc_contents.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/flowchart/__init__.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/flowchart/dot_to_yaml.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/flowchart/graph.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/html_comments.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/html_uncomments.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/match_spaces.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/notebook/__init__.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/notebook/fast_build.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/notebook/tex_to_qmd.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/onewordify.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/onewordify_undo.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/outline.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/rearrange_tex.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/searchacro.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/separate_comments.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/split_conflict.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/unseparate_comments.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/update_check.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/wrap_sentences.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/pydifftools/xml2xlsx.vbs +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/setup.cfg +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/tests/test_browser_lifecycle.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/tests/test_continuous_shutdown.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/tests/test_rrng.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/tests/test_tex_to_qmd.py +0 -0
- {pydifftools-0.1.23 → pydifftools-0.1.24}/tests/test_update_check.py +0 -0
|
@@ -796,8 +796,35 @@ def pmd(arguments):
|
|
|
796
796
|
p1.wait()
|
|
797
797
|
|
|
798
798
|
|
|
799
|
+
def _subcommand_help_hint(prog):
|
|
800
|
+
return (
|
|
801
|
+
f"*** Run '{prog} --help <subcommand>' to learn about "
|
|
802
|
+
"subcommand options. ***"
|
|
803
|
+
)
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
class PyDiffArgumentParser(argparse.ArgumentParser):
|
|
807
|
+
"""ArgumentParser with a clearer root-level missing-subcommand hint."""
|
|
808
|
+
|
|
809
|
+
def __init__(self, *args, is_root_parser=False, **kwargs):
|
|
810
|
+
super().__init__(*args, **kwargs)
|
|
811
|
+
self._pydifft_is_root_parser = is_root_parser
|
|
812
|
+
|
|
813
|
+
def error(self, message):
|
|
814
|
+
if self._pydifft_is_root_parser:
|
|
815
|
+
self.print_usage(sys.stderr)
|
|
816
|
+
hint = _subcommand_help_hint(self.prog)
|
|
817
|
+
self.exit(2, f"{self.prog}: error: {message}\n{hint}\n")
|
|
818
|
+
super().error(message)
|
|
819
|
+
|
|
820
|
+
|
|
799
821
|
def build_parser():
|
|
800
|
-
parser =
|
|
822
|
+
parser = PyDiffArgumentParser(
|
|
823
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
824
|
+
is_root_parser=True,
|
|
825
|
+
)
|
|
826
|
+
parser.epilog = _subcommand_help_hint(parser.prog)
|
|
827
|
+
parser._pydifft_subparsers = {}
|
|
801
828
|
subparsers = parser.add_subparsers(dest="command")
|
|
802
829
|
subparsers.required = True
|
|
803
830
|
for name, spec in _COMMAND_SPECS.items():
|
|
@@ -823,10 +850,18 @@ def build_parser():
|
|
|
823
850
|
action.completer = FilesCompleter(
|
|
824
851
|
allowednames=["*.yaml", "*.yml"]
|
|
825
852
|
)
|
|
853
|
+
if (
|
|
854
|
+
FilesCompleter is not None
|
|
855
|
+
and name == "cpb"
|
|
856
|
+
and action.dest == "filename"
|
|
857
|
+
):
|
|
858
|
+
# Provide Markdown-only completions for continuous pandoc build.
|
|
859
|
+
action.completer = FilesCompleter(allowednames=["*.md"])
|
|
826
860
|
if name == "wgrph" and action.dest == "t":
|
|
827
861
|
# Offer case-insensitive completions for incomplete task names.
|
|
828
862
|
action.completer = wgrph_task_completer
|
|
829
863
|
subparser.set_defaults(_handler=spec["handler"])
|
|
864
|
+
parser._pydifft_subparsers[name] = subparser
|
|
830
865
|
return parser
|
|
831
866
|
|
|
832
867
|
|
|
@@ -859,6 +894,11 @@ def main(argv=None):
|
|
|
859
894
|
if not argv:
|
|
860
895
|
parser.print_help()
|
|
861
896
|
return
|
|
897
|
+
if argv[0] in ("-h", "--help") and len(argv) > 1:
|
|
898
|
+
subcommand = argv[1]
|
|
899
|
+
if subcommand in parser._pydifft_subparsers:
|
|
900
|
+
parser._pydifft_subparsers[subcommand].print_help()
|
|
901
|
+
return
|
|
862
902
|
namespace = parser.parse_args(argv)
|
|
863
903
|
handler = namespace._handler
|
|
864
904
|
handler_kwargs = dict(vars(namespace))
|
|
@@ -185,6 +185,48 @@ def _svg_shape_bounds(shape, namespace):
|
|
|
185
185
|
return None
|
|
186
186
|
|
|
187
187
|
|
|
188
|
+
def _svg_parse_viewbox(svg_root):
|
|
189
|
+
viewbox = svg_root.attrib.get("viewBox")
|
|
190
|
+
if viewbox is None:
|
|
191
|
+
return None
|
|
192
|
+
parts = viewbox.replace(",", " ").split()
|
|
193
|
+
if len(parts) != 4:
|
|
194
|
+
return None
|
|
195
|
+
try:
|
|
196
|
+
return tuple(float(part) for part in parts)
|
|
197
|
+
except ValueError:
|
|
198
|
+
return None
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _svg_add_canvas_padding(svg_root, padding=8.0):
|
|
202
|
+
# Graphviz emits a tight canvas; add small fixed padding so post-processed
|
|
203
|
+
# outlines and anti-aliased strokes are never clipped at edges.
|
|
204
|
+
viewbox = _svg_parse_viewbox(svg_root)
|
|
205
|
+
if viewbox is None:
|
|
206
|
+
return
|
|
207
|
+
|
|
208
|
+
view_x, view_y, view_w, view_h = viewbox
|
|
209
|
+
if view_w <= 0.0 or view_h <= 0.0:
|
|
210
|
+
return
|
|
211
|
+
|
|
212
|
+
new_view_x = view_x - padding
|
|
213
|
+
new_view_y = view_y - padding
|
|
214
|
+
new_view_w = view_w + 2.0 * padding
|
|
215
|
+
new_view_h = view_h + 2.0 * padding
|
|
216
|
+
svg_root.set(
|
|
217
|
+
"viewBox",
|
|
218
|
+
f"{new_view_x:.2f} {new_view_y:.2f} {new_view_w:.2f} {new_view_h:.2f}",
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def _watch_html(svg_file):
|
|
223
|
+
return (
|
|
224
|
+
"<html><body style='margin:0'><embed id='svg-view'"
|
|
225
|
+
" style='display:block;' type='image/svg+xml'"
|
|
226
|
+
f" src='{svg_file.name}?t={time.time()}'/></body></html>"
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
188
230
|
def _svg_expanded_outline(
|
|
189
231
|
shape, namespace, expand, stroke_color, stroke_width
|
|
190
232
|
):
|
|
@@ -249,6 +291,12 @@ def build_graph(
|
|
|
249
291
|
["dot", "-Tsvg", str(dot_file), "-o", str(svg_file)],
|
|
250
292
|
check=True,
|
|
251
293
|
)
|
|
294
|
+
svg_tree = ET.parse(str(svg_file))
|
|
295
|
+
svg_root = svg_tree.getroot()
|
|
296
|
+
namespace = ""
|
|
297
|
+
if svg_root.tag.startswith("{"):
|
|
298
|
+
namespace = svg_root.tag[: svg_root.tag.find("}") + 1]
|
|
299
|
+
|
|
252
300
|
if not order_by_date:
|
|
253
301
|
# In dependency view mode, each node explicitly tagged with
|
|
254
302
|
# ``style: endpoint`` defines a project color. A project includes the
|
|
@@ -282,12 +330,6 @@ def build_graph(
|
|
|
282
330
|
for parent in data["nodes"][ancestor]["parents"]:
|
|
283
331
|
ancestors_to_visit.append(parent)
|
|
284
332
|
|
|
285
|
-
svg_tree = ET.parse(str(svg_file))
|
|
286
|
-
svg_root = svg_tree.getroot()
|
|
287
|
-
namespace = ""
|
|
288
|
-
if svg_root.tag.startswith("{"):
|
|
289
|
-
namespace = svg_root.tag[: svg_root.tag.find("}") + 1]
|
|
290
|
-
|
|
291
333
|
title_to_group = {}
|
|
292
334
|
node_title_to_group = {}
|
|
293
335
|
for group in svg_root.iter(f"{namespace}g"):
|
|
@@ -449,7 +491,8 @@ def build_graph(
|
|
|
449
491
|
for insert_index, outline in reversed(inserts):
|
|
450
492
|
group.insert(insert_index, outline)
|
|
451
493
|
|
|
452
|
-
|
|
494
|
+
_svg_add_canvas_padding(svg_root, padding=24.0)
|
|
495
|
+
svg_tree.write(str(svg_file), encoding="utf-8", xml_declaration=True)
|
|
453
496
|
return data
|
|
454
497
|
|
|
455
498
|
|
|
@@ -565,11 +608,7 @@ def wgrph(yaml, wrap_width=55, d=False, t=None):
|
|
|
565
608
|
# Render the initial graph, optionally restricting to incomplete ancestors
|
|
566
609
|
# of a target task.
|
|
567
610
|
data = build_graph(yaml_file, dot_file, svg_file, wrap_width, d, None, t)
|
|
568
|
-
html_file.write_text(
|
|
569
|
-
"<html><body style='margin:0'><embed id='svg-view'"
|
|
570
|
-
" type='image/svg+xml'"
|
|
571
|
-
f" src='{svg_file.name}?t={time.time()}'/></body></html>"
|
|
572
|
-
)
|
|
611
|
+
html_file.write_text(_watch_html(svg_file))
|
|
573
612
|
options = Options()
|
|
574
613
|
driver = start_chrome(webdriver, options, html_file)
|
|
575
614
|
event_handler = GraphEventHandler(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/__version__.txt
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
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/.jupyter_cache/global.db
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg
RENAMED
|
File without changes
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/independent.qmd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/test_include.qmd
RENAMED
|
File without changes
|
{pydifftools-0.1.23 → pydifftools-0.1.24}/example_notebook/project1/subproject1/tryforerror.qmd
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|