pyDiffTools 0.1.37__tar.gz → 0.1.38__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.37/pyDiffTools.egg-info → pydifftools-0.1.38}/PKG-INFO +1 -1
- {pydifftools-0.1.37 → pydifftools-0.1.38/pyDiffTools.egg-info}/PKG-INFO +1 -1
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_migration.py +11 -7
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyproject.toml +1 -1
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_comment_migration.py +11 -2
- {pydifftools-0.1.37 → pydifftools-0.1.38}/LICENSE.md +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/MANIFEST.in +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/README.rst +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/_quarto.yml +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/__version__.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/1a724af72b16f5a9e607e12b1c721645/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/1b28fc9daac9081847e5161b2c546f8a/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/231f64eee282fa225d1104935cf80a24/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/26e56f6b0ff54851a45145157f2f0dc4/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/311fabd7029ffd050d056e2f316eb50f/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/57da2021e5b156ac3adf01398201c723/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/62b24ea7da75011d92b0f8924faa208d/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/7f1b20d69d889514ab5d1cc92e3cb14f/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/86f74c8c54a87ff892d9b15dd714e8f0/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/88893b4234eac2945d9d6cb2e277f186/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/9a40046ada6f582ee34af00fbdbfb417/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/a1bf4d270d0641ff41faf1d7cce3439a/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/a3789f7d9585a781f2a1c60ce95ff10d/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/be46ecba858d39ad5f0c46902ddf1c02/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/d0cbc57a12f2ccce710a5afd04cc05e7/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/d3e12d320b14228f701231ae32ddd7dd/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/eb434f61555438d020a6970a5dbf9ee8/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/f6b0e73aa7fa029134665d4dde57e096/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/f719a6e4ff09873cb0ffb06ec9d232f9/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/executed/feeee244a7ce3d60e1a227eb604df823/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/.jupyter_cache/global.db +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/example.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/example.tex +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/index.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/.jupyter_cache/__version__.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/.jupyter_cache/executed/ca90e4df5f4f0583df6554156a68dc7f/base.ipynb +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/.jupyter_cache/global.db +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/independent.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/index.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/tasks.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/test_include.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/tryforerror.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/test_include.qmd +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyDiffTools.egg-info/SOURCES.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyDiffTools.egg-info/dependency_links.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyDiffTools.egg-info/entry_points.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyDiffTools.egg-info/requires.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pyDiffTools.egg-info/top_level.txt +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/__init__.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/bibliography.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/browser_lifecycle.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/check_numbers.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/citation_dialog.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/command_line.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/command_registry.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_functions.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_tags.lua +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_tags_margin.lua +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_tags_no_comments.lua +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comment_toggle.js +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/comments.css +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/continuous.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/copy_files.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/diff-doc.js +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/doc_contents.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/__init__.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/comparison.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/dot_to_yaml.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/graph.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/svg-pan-zoom.min.js +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/watch_graph.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/flowchart/wgrph_view.js +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/forward_search.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/git_gd.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/git_gd_history.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/git_gd_image.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/git_gd_qt.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/html_comments.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/html_uncomments.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/log_example.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/match_spaces.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/notebook/__init__.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/notebook/display.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/notebook/fast_build.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/notebook/tex_to_qmd.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/onewordify.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/onewordify_undo.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/outline.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/rearrange_tex.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/searchacro.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/separate_comments.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/split_conflict.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/unseparate_comments.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/update_check.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/wrap_sentences.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/xml2xlsx.vbs +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/pydifftools/zotero.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/setup.cfg +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_bibliography.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_browser_lifecycle.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_check_single_use.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_command_line_help.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_continuous_shutdown.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_forward_search.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_git_gd_history.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_git_gd_image.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_git_gd_qt.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_rrng.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_tex_to_qmd.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_update_check.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_wrap_check.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_wrapping.py +0 -0
- {pydifftools-0.1.37 → pydifftools-0.1.38}/tests/test_zotero.py +0 -0
|
@@ -78,7 +78,7 @@ def _most_distant_hue(colors):
|
|
|
78
78
|
return (start + gap_size / 2) % 360
|
|
79
79
|
|
|
80
80
|
|
|
81
|
-
def _migration_dialog(
|
|
81
|
+
def _migration_dialog(filename, colors, legacy):
|
|
82
82
|
"""Ask Qt for all migrations and return decisions without editing files."""
|
|
83
83
|
script = r"""
|
|
84
84
|
import colorsys
|
|
@@ -95,6 +95,8 @@ from PySide6.QtWidgets import (
|
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
payload = json.loads(sys.argv[1])
|
|
98
|
+
with open(sys.argv[2], encoding="utf-8", newline="") as fp:
|
|
99
|
+
text = fp.read()
|
|
98
100
|
colors = payload["colors"]
|
|
99
101
|
app = QApplication(sys.argv[:1])
|
|
100
102
|
result = {"accepted": True, "replacements": {}, "colors": {}}
|
|
@@ -201,9 +203,9 @@ legacy = payload["legacy"]
|
|
|
201
203
|
if legacy:
|
|
202
204
|
initials = ask_legacy_initials()
|
|
203
205
|
legacy_occurrences = len(re.findall(
|
|
204
|
-
r"</?comment(?:-(?:left|right))?>",
|
|
206
|
+
r"</?comment(?:-(?:left|right))?>", text, re.I
|
|
205
207
|
)) + len(re.findall(
|
|
206
|
-
r"\.comment-(?:left|right)(?=[\s}])",
|
|
208
|
+
r"\.comment-(?:left|right)(?=[\s}])", text, re.I
|
|
207
209
|
))
|
|
208
210
|
if initials is None:
|
|
209
211
|
result["accepted"] = False
|
|
@@ -222,12 +224,12 @@ if legacy:
|
|
|
222
224
|
if result["accepted"]:
|
|
223
225
|
authors = sorted(set(
|
|
224
226
|
initials.upper() for initials in re.findall(
|
|
225
|
-
r"</?([A-Za-z]{2})com(?:-(?:left|right))?>",
|
|
227
|
+
r"</?([A-Za-z]{2})com(?:-(?:left|right))?>", text, re.I
|
|
226
228
|
)
|
|
227
229
|
) | set(
|
|
228
230
|
initials.upper() for initials in re.findall(
|
|
229
231
|
r"\.([A-Za-z]{2})com(?:-(?:left|right))?(?=[\s}])",
|
|
230
|
-
|
|
232
|
+
text, re.I
|
|
231
233
|
)
|
|
232
234
|
))
|
|
233
235
|
if result["replacements"].get("legacy"):
|
|
@@ -279,8 +281,10 @@ if result["accepted"]:
|
|
|
279
281
|
print(json.dumps(result))
|
|
280
282
|
"""
|
|
281
283
|
completed = subprocess.run(
|
|
284
|
+
# the dialog reads the document from its file, since the text of a
|
|
285
|
+
# large document exceeds the operating system's argument limit
|
|
282
286
|
[sys.executable, "-c", textwrap.dedent(script),
|
|
283
|
-
json.dumps({"
|
|
287
|
+
json.dumps({"colors": colors, "legacy": legacy}), filename],
|
|
284
288
|
capture_output=True, text=True,
|
|
285
289
|
)
|
|
286
290
|
if completed.returncode:
|
|
@@ -319,7 +323,7 @@ def prepare_comment_source(filename):
|
|
|
319
323
|
}
|
|
320
324
|
if not has_legacy and authors.issubset(colors):
|
|
321
325
|
return original
|
|
322
|
-
decisions = _migration_dialog(
|
|
326
|
+
decisions = _migration_dialog(filename, colors, has_legacy)
|
|
323
327
|
if not decisions.get("accepted"):
|
|
324
328
|
raise RuntimeError("cpb comment migration was canceled")
|
|
325
329
|
updated = original
|
|
@@ -13,11 +13,14 @@ def test_hue_picker_starts_at_seed_and_fills_largest_hue_gap():
|
|
|
13
13
|
assert _most_distant_hue(["#ff0000", "#00ff00"]) == pytest.approx(240)
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def test_migration_dialog_builds_qt_script_and_decodes_result(
|
|
16
|
+
def test_migration_dialog_builds_qt_script_and_decodes_result(
|
|
17
|
+
tmp_path, monkeypatch
|
|
18
|
+
):
|
|
17
19
|
captured = {}
|
|
18
20
|
|
|
19
21
|
def fake_run(command, **_kwargs):
|
|
20
22
|
captured["script"] = command[2]
|
|
23
|
+
captured["command"] = command
|
|
21
24
|
compile(command[2], "<comment migration dialog>", "exec")
|
|
22
25
|
return type(
|
|
23
26
|
"Completed",
|
|
@@ -27,11 +30,17 @@ def test_migration_dialog_builds_qt_script_and_decodes_result(monkeypatch):
|
|
|
27
30
|
|
|
28
31
|
monkeypatch.setattr(comment_migration.subprocess, "run", fake_run)
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
path = tmp_path / "notes.md"
|
|
34
|
+
path.write_text("<ABcom>note</ABcom>", encoding="utf-8")
|
|
35
|
+
result = _migration_dialog(str(path), {}, False)
|
|
31
36
|
|
|
32
37
|
assert result == {"accepted": True}
|
|
33
38
|
assert "QColor.fromHsv" in captured["script"]
|
|
34
39
|
assert "QComboBox" in captured["script"]
|
|
40
|
+
# the document is passed by filename, since large files exceed the argv
|
|
41
|
+
# limit
|
|
42
|
+
assert captured["command"][4] == str(path)
|
|
43
|
+
assert "<ABcom>" not in captured["command"][3]
|
|
35
44
|
|
|
36
45
|
|
|
37
46
|
def test_prepare_migrates_legacy_tags_and_div_classes(tmp_path, monkeypatch):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydifftools-0.1.37 → pydifftools-0.1.38}/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.37 → pydifftools-0.1.38}/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.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg
RENAMED
|
File without changes
|
{pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/independent.qmd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydifftools-0.1.37 → pydifftools-0.1.38}/example_notebook/project1/subproject1/test_include.qmd
RENAMED
|
File without changes
|
{pydifftools-0.1.37 → pydifftools-0.1.38}/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
|
|
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
|