pyDiffTools 0.1.29__tar.gz → 0.1.31__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 (109) hide show
  1. {pydifftools-0.1.29/pyDiffTools.egg-info → pydifftools-0.1.31}/PKG-INFO +46 -4
  2. {pydifftools-0.1.29 → pydifftools-0.1.31}/README.rst +42 -3
  3. {pydifftools-0.1.29 → pydifftools-0.1.31/pyDiffTools.egg-info}/PKG-INFO +46 -4
  4. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyDiffTools.egg-info/SOURCES.txt +12 -1
  5. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyDiffTools.egg-info/requires.txt +3 -0
  6. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/command_line.py +52 -27
  7. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/continuous.py +287 -136
  8. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/doc_contents.py +23 -8
  9. pydifftools-0.1.31/pydifftools/flowchart/comparison.py +331 -0
  10. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/flowchart/graph.py +15 -18
  11. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/flowchart/watch_graph.py +195 -229
  12. pydifftools-0.1.31/pydifftools/forward_search.py +124 -0
  13. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/git_gd.py +216 -58
  14. pydifftools-0.1.31/pydifftools/git_gd_history.py +347 -0
  15. pydifftools-0.1.31/pydifftools/git_gd_image.py +754 -0
  16. pydifftools-0.1.31/pydifftools/git_gd_qt.py +591 -0
  17. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/match_spaces.py +380 -235
  18. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/notebook/fast_build.py +982 -726
  19. pydifftools-0.1.31/pydifftools/outline.py +184 -0
  20. pydifftools-0.1.31/pydifftools/wrap_sentences.py +1022 -0
  21. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyproject.toml +4 -1
  22. pydifftools-0.1.31/tests/test_check_single_use.py +45 -0
  23. pydifftools-0.1.31/tests/test_continuous_shutdown.py +391 -0
  24. pydifftools-0.1.31/tests/test_forward_search.py +339 -0
  25. pydifftools-0.1.31/tests/test_git_gd_history.py +205 -0
  26. pydifftools-0.1.31/tests/test_git_gd_image.py +316 -0
  27. pydifftools-0.1.31/tests/test_git_gd_qt.py +142 -0
  28. pydifftools-0.1.31/tests/test_wrap_check.py +141 -0
  29. pydifftools-0.1.31/tests/test_wrapping.py +500 -0
  30. pydifftools-0.1.29/pydifftools/git_gd_qt.py +0 -334
  31. pydifftools-0.1.29/pydifftools/outline.py +0 -173
  32. pydifftools-0.1.29/pydifftools/wrap_sentences.py +0 -501
  33. pydifftools-0.1.29/tests/test_continuous_shutdown.py +0 -64
  34. {pydifftools-0.1.29 → pydifftools-0.1.31}/LICENSE.md +0 -0
  35. {pydifftools-0.1.29 → pydifftools-0.1.31}/MANIFEST.in +0 -0
  36. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/_quarto.yml +0 -0
  37. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/__version__.txt +0 -0
  38. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/1a724af72b16f5a9e607e12b1c721645/base.ipynb +0 -0
  39. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/1b28fc9daac9081847e5161b2c546f8a/base.ipynb +0 -0
  40. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/231f64eee282fa225d1104935cf80a24/base.ipynb +0 -0
  41. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/26e56f6b0ff54851a45145157f2f0dc4/base.ipynb +0 -0
  42. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/311fabd7029ffd050d056e2f316eb50f/base.ipynb +0 -0
  43. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/57da2021e5b156ac3adf01398201c723/base.ipynb +0 -0
  44. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/62b24ea7da75011d92b0f8924faa208d/base.ipynb +0 -0
  45. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/7f1b20d69d889514ab5d1cc92e3cb14f/base.ipynb +0 -0
  46. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/86f74c8c54a87ff892d9b15dd714e8f0/base.ipynb +0 -0
  47. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/88893b4234eac2945d9d6cb2e277f186/base.ipynb +0 -0
  48. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/9a40046ada6f582ee34af00fbdbfb417/base.ipynb +0 -0
  49. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/a1bf4d270d0641ff41faf1d7cce3439a/base.ipynb +0 -0
  50. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/a3789f7d9585a781f2a1c60ce95ff10d/base.ipynb +0 -0
  51. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/be46ecba858d39ad5f0c46902ddf1c02/base.ipynb +0 -0
  52. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/d0cbc57a12f2ccce710a5afd04cc05e7/base.ipynb +0 -0
  53. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/d3e12d320b14228f701231ae32ddd7dd/base.ipynb +0 -0
  54. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/eb434f61555438d020a6970a5dbf9ee8/base.ipynb +0 -0
  55. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/f6b0e73aa7fa029134665d4dde57e096/base.ipynb +0 -0
  56. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/f719a6e4ff09873cb0ffb06ec9d232f9/base.ipynb +0 -0
  57. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/executed/feeee244a7ce3d60e1a227eb604df823/base.ipynb +0 -0
  58. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/.jupyter_cache/global.db +0 -0
  59. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/example.qmd +0 -0
  60. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/example.tex +0 -0
  61. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/index.qmd +0 -0
  62. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/.jupyter_cache/__version__.txt +0 -0
  63. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/.jupyter_cache/executed/ca90e4df5f4f0583df6554156a68dc7f/base.ipynb +0 -0
  64. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/.jupyter_cache/global.db +0 -0
  65. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg +0 -0
  66. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/independent.qmd +0 -0
  67. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/index.qmd +0 -0
  68. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/tasks.qmd +0 -0
  69. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/test_include.qmd +0 -0
  70. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/subproject1/tryforerror.qmd +0 -0
  71. {pydifftools-0.1.29 → pydifftools-0.1.31}/example_notebook/project1/test_include.qmd +0 -0
  72. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyDiffTools.egg-info/dependency_links.txt +0 -0
  73. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyDiffTools.egg-info/entry_points.txt +0 -0
  74. {pydifftools-0.1.29 → pydifftools-0.1.31}/pyDiffTools.egg-info/top_level.txt +0 -0
  75. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/__init__.py +0 -0
  76. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/browser_lifecycle.py +0 -0
  77. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/check_numbers.py +0 -0
  78. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/command_registry.py +0 -0
  79. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comment_functions.py +0 -0
  80. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comment_tags.lua +0 -0
  81. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comment_tags_margin.lua +0 -0
  82. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comment_tags_no_comments.lua +0 -0
  83. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comment_toggle.js +0 -0
  84. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/comments.css +0 -0
  85. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/copy_files.py +0 -0
  86. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/diff-doc.js +0 -0
  87. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/flowchart/__init__.py +0 -0
  88. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/flowchart/dot_to_yaml.py +0 -0
  89. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/html_comments.py +0 -0
  90. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/html_uncomments.py +0 -0
  91. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/log_example.py +0 -0
  92. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/notebook/__init__.py +0 -0
  93. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/notebook/display.py +0 -0
  94. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/notebook/tex_to_qmd.py +0 -0
  95. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/onewordify.py +0 -0
  96. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/onewordify_undo.py +0 -0
  97. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/rearrange_tex.py +0 -0
  98. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/searchacro.py +0 -0
  99. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/separate_comments.py +0 -0
  100. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/split_conflict.py +0 -0
  101. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/unseparate_comments.py +0 -0
  102. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/update_check.py +0 -0
  103. {pydifftools-0.1.29 → pydifftools-0.1.31}/pydifftools/xml2xlsx.vbs +0 -0
  104. {pydifftools-0.1.29 → pydifftools-0.1.31}/setup.cfg +0 -0
  105. {pydifftools-0.1.29 → pydifftools-0.1.31}/tests/test_browser_lifecycle.py +0 -0
  106. {pydifftools-0.1.29 → pydifftools-0.1.31}/tests/test_command_line_help.py +0 -0
  107. {pydifftools-0.1.29 → pydifftools-0.1.31}/tests/test_rrng.py +0 -0
  108. {pydifftools-0.1.29 → pydifftools-0.1.31}/tests/test_tex_to_qmd.py +0 -0
  109. {pydifftools-0.1.29 → pydifftools-0.1.31}/tests/test_update_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyDiffTools
3
- Version: 0.1.29
3
+ Version: 0.1.31
4
4
  Summary: Diff tools
5
5
  Author: J M Franck
6
6
  License: Copyright (c) 2015, jmfranck
@@ -34,6 +34,8 @@ License: Copyright (c) 2015, jmfranck
34
34
 
35
35
  Description-Content-Type: text/x-rst
36
36
  License-File: LICENSE.md
37
+ Requires-Dist: numpy
38
+ Requires-Dist: Pillow
37
39
  Requires-Dist: selenium
38
40
  Requires-Dist: fuzzywuzzy[speedup]
39
41
  Requires-Dist: PyYAML>=6.0
@@ -48,6 +50,7 @@ Requires-Dist: nbconvert
48
50
  Requires-Dist: pygments
49
51
  Requires-Dist: ansi2html
50
52
  Requires-Dist: lxml
53
+ Requires-Dist: PySide6
51
54
  Dynamic: license-file
52
55
 
53
56
  pydifftools
@@ -98,6 +101,15 @@ included are (listed in order of fun/utility):
98
101
  refreshed as you edit the file. This wraps the former
99
102
  ``flowchart/watch_graph.py`` script so all of its functionality is now
100
103
  available through the main ``pydifft`` entry point.
104
+ Add ``--diff-base HEAD`` (or a branch, tag, commit, or quoted reflog
105
+ reference) to compare against that Git snapshot throughout the preview
106
+ session. Additions are green, deletions are red and struck through, and
107
+ unchanged content is muted. Renames share one box; date, status, and
108
+ dependency changes are annotated. Navigation, filters, and reloads retain
109
+ the baseline, whose reference and commit appear below the graph.
110
+ Comparison uses the same repository-relative YAML path; a file absent
111
+ from the revision is treated as an empty plan. Historical file renames
112
+ are not followed, and comparison markup is never written to YAML.
101
113
  - `pydifft tex2qmd file.tex` converts LaTeX sources to Quarto markdown.
102
114
  The converter preserves custom observation blocks and errata tags while
103
115
  translating verbatim/python environments into fenced code blocks so the
@@ -108,10 +120,32 @@ included are (listed in order of fun/utility):
108
120
  ``_build``/``_display`` directories; with ``--watch`` it starts the HTTP
109
121
  server and automatically rebuilds the staged fragments whenever you edit
110
122
  a ``.qmd`` file.
111
- - `pydifft gd [git diff args...]` shows the same Qt review table as the old
123
+ - ``pydifft tree`` (or ``git tree`` with the alias installed) opens the last
124
+ 40 commits across all branches, in Git date order. Use the down arrow
125
+ below the history to add the next 40 commits. Colors follow
126
+ first-parent ancestry; merged branches join the receiving branch.
127
+ Tags and branch tips have vector icon badges; hashes appear on hover.
128
+ Click any part of a commit row
129
+ to compare with the working directory, or right-click to copy its hash
130
+ or set a commit as the comparison endpoint. The right-click menu can restore
131
+ the working-directory endpoint. Diff window titles show the equivalent
132
+ arguments, preferring tags, then branch names, then six-character hashes.
133
+ Run ``pydifft tree --install`` to add the matching ``git tree`` alias.
134
+ - ``pydifft gd`` (or ``git gd`` with the alias installed) reviews unstaged
135
+ changes, like bare ``git diff``.
136
+ ``pydifft gd [git diff args...]`` shows the same Qt review table as the old
112
137
  ``git_gd_qt.py`` helper before launching ``git difftool`` for a selected
113
- file. Run ``pydifft gd --install`` to add the matching ``git gd`` alias
114
- to your global git config.
138
+ file.
139
+ Image rows are scored in the background and displayed as normalized
140
+ ``rgb X.X a X.X`` RMS changes; RGB change orders the image rows as scores
141
+ arrive.
142
+ Raster images open in a Qt viewer that aligns the old and new image,
143
+ displays their RGB difference, and uses up/down controls to switch
144
+ among the original, difference, and aligned new image. Images with an
145
+ alpha channel are displayed over a checkerboard; when transparency
146
+ changes, an additional red/blue alpha-difference view is included.
147
+ Run ``pydifft gd --install`` to add the matching ``git gd`` alias to
148
+ your global git config.
115
149
  - `pydifft qmdinit [directory]` scaffolds a new Quarto-style project using
116
150
  the bundled templates and example ``project1`` hierarchy, then downloads
117
151
  MathJax into ``_template/mathjax`` so the builder can run immediately.
@@ -122,12 +156,20 @@ included are (listed in order of fun/utility):
122
156
  wrapping, ideal for when you are
123
157
  working on manuscripts that you
124
158
  are version tracking with git.
159
+ Headers, fenced code blocks, and Pandoc tables retain their formatting.
160
+ Display-math delimiters get their own lines while equation contents retain
161
+ their wrapping; inline-math boundaries are preferred places to wrap prose.
125
162
  - `pydifft wmatch` ("whitespace match"): a script that matches whitespace between two text files.
126
163
 
127
164
  * pandoc can convert between markdown/latex/word, but doing this messes with your whitespace and gvimdiff comparisons.
128
165
 
129
166
  * this allows you to use an original file with good whitespace formatting as a "template" that you can match other (e.g. pandoc converted file) onto another
130
167
 
168
+ * changed prose lines exceeding 1.5 times the nearby reference width are
169
+ wrapped using the same sentence and punctuation rules as ``wr``.
170
+ Existing surrounding line breaks are retained; the fallback width is
171
+ 80 columns when the reference provides too little prose.
172
+
131
173
  - `pydifft wd` ("word diff"): generate "track changes" word files starting from pandoc markdown in a git history. Assuming that you have copied diff-doc.js (copied + licensed from elsewhere) into your home directory, this will use pandoc to convert the markdown files to MS Word, then use the MS Word comparison tool to generate a document where all relevant changes are shown with "track changes."
132
174
 
133
175
  * by default, this uses the file `template.docx` in the current directory as a pandoc word template
@@ -46,6 +46,15 @@ included are (listed in order of fun/utility):
46
46
  refreshed as you edit the file. This wraps the former
47
47
  ``flowchart/watch_graph.py`` script so all of its functionality is now
48
48
  available through the main ``pydifft`` entry point.
49
+ Add ``--diff-base HEAD`` (or a branch, tag, commit, or quoted reflog
50
+ reference) to compare against that Git snapshot throughout the preview
51
+ session. Additions are green, deletions are red and struck through, and
52
+ unchanged content is muted. Renames share one box; date, status, and
53
+ dependency changes are annotated. Navigation, filters, and reloads retain
54
+ the baseline, whose reference and commit appear below the graph.
55
+ Comparison uses the same repository-relative YAML path; a file absent
56
+ from the revision is treated as an empty plan. Historical file renames
57
+ are not followed, and comparison markup is never written to YAML.
49
58
  - `pydifft tex2qmd file.tex` converts LaTeX sources to Quarto markdown.
50
59
  The converter preserves custom observation blocks and errata tags while
51
60
  translating verbatim/python environments into fenced code blocks so the
@@ -56,10 +65,32 @@ included are (listed in order of fun/utility):
56
65
  ``_build``/``_display`` directories; with ``--watch`` it starts the HTTP
57
66
  server and automatically rebuilds the staged fragments whenever you edit
58
67
  a ``.qmd`` file.
59
- - `pydifft gd [git diff args...]` shows the same Qt review table as the old
68
+ - ``pydifft tree`` (or ``git tree`` with the alias installed) opens the last
69
+ 40 commits across all branches, in Git date order. Use the down arrow
70
+ below the history to add the next 40 commits. Colors follow
71
+ first-parent ancestry; merged branches join the receiving branch.
72
+ Tags and branch tips have vector icon badges; hashes appear on hover.
73
+ Click any part of a commit row
74
+ to compare with the working directory, or right-click to copy its hash
75
+ or set a commit as the comparison endpoint. The right-click menu can restore
76
+ the working-directory endpoint. Diff window titles show the equivalent
77
+ arguments, preferring tags, then branch names, then six-character hashes.
78
+ Run ``pydifft tree --install`` to add the matching ``git tree`` alias.
79
+ - ``pydifft gd`` (or ``git gd`` with the alias installed) reviews unstaged
80
+ changes, like bare ``git diff``.
81
+ ``pydifft gd [git diff args...]`` shows the same Qt review table as the old
60
82
  ``git_gd_qt.py`` helper before launching ``git difftool`` for a selected
61
- file. Run ``pydifft gd --install`` to add the matching ``git gd`` alias
62
- to your global git config.
83
+ file.
84
+ Image rows are scored in the background and displayed as normalized
85
+ ``rgb X.X a X.X`` RMS changes; RGB change orders the image rows as scores
86
+ arrive.
87
+ Raster images open in a Qt viewer that aligns the old and new image,
88
+ displays their RGB difference, and uses up/down controls to switch
89
+ among the original, difference, and aligned new image. Images with an
90
+ alpha channel are displayed over a checkerboard; when transparency
91
+ changes, an additional red/blue alpha-difference view is included.
92
+ Run ``pydifft gd --install`` to add the matching ``git gd`` alias to
93
+ your global git config.
63
94
  - `pydifft qmdinit [directory]` scaffolds a new Quarto-style project using
64
95
  the bundled templates and example ``project1`` hierarchy, then downloads
65
96
  MathJax into ``_template/mathjax`` so the builder can run immediately.
@@ -70,12 +101,20 @@ included are (listed in order of fun/utility):
70
101
  wrapping, ideal for when you are
71
102
  working on manuscripts that you
72
103
  are version tracking with git.
104
+ Headers, fenced code blocks, and Pandoc tables retain their formatting.
105
+ Display-math delimiters get their own lines while equation contents retain
106
+ their wrapping; inline-math boundaries are preferred places to wrap prose.
73
107
  - `pydifft wmatch` ("whitespace match"): a script that matches whitespace between two text files.
74
108
 
75
109
  * pandoc can convert between markdown/latex/word, but doing this messes with your whitespace and gvimdiff comparisons.
76
110
 
77
111
  * this allows you to use an original file with good whitespace formatting as a "template" that you can match other (e.g. pandoc converted file) onto another
78
112
 
113
+ * changed prose lines exceeding 1.5 times the nearby reference width are
114
+ wrapped using the same sentence and punctuation rules as ``wr``.
115
+ Existing surrounding line breaks are retained; the fallback width is
116
+ 80 columns when the reference provides too little prose.
117
+
79
118
  - `pydifft wd` ("word diff"): generate "track changes" word files starting from pandoc markdown in a git history. Assuming that you have copied diff-doc.js (copied + licensed from elsewhere) into your home directory, this will use pandoc to convert the markdown files to MS Word, then use the MS Word comparison tool to generate a document where all relevant changes are shown with "track changes."
80
119
 
81
120
  * by default, this uses the file `template.docx` in the current directory as a pandoc word template
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyDiffTools
3
- Version: 0.1.29
3
+ Version: 0.1.31
4
4
  Summary: Diff tools
5
5
  Author: J M Franck
6
6
  License: Copyright (c) 2015, jmfranck
@@ -34,6 +34,8 @@ License: Copyright (c) 2015, jmfranck
34
34
 
35
35
  Description-Content-Type: text/x-rst
36
36
  License-File: LICENSE.md
37
+ Requires-Dist: numpy
38
+ Requires-Dist: Pillow
37
39
  Requires-Dist: selenium
38
40
  Requires-Dist: fuzzywuzzy[speedup]
39
41
  Requires-Dist: PyYAML>=6.0
@@ -48,6 +50,7 @@ Requires-Dist: nbconvert
48
50
  Requires-Dist: pygments
49
51
  Requires-Dist: ansi2html
50
52
  Requires-Dist: lxml
53
+ Requires-Dist: PySide6
51
54
  Dynamic: license-file
52
55
 
53
56
  pydifftools
@@ -98,6 +101,15 @@ included are (listed in order of fun/utility):
98
101
  refreshed as you edit the file. This wraps the former
99
102
  ``flowchart/watch_graph.py`` script so all of its functionality is now
100
103
  available through the main ``pydifft`` entry point.
104
+ Add ``--diff-base HEAD`` (or a branch, tag, commit, or quoted reflog
105
+ reference) to compare against that Git snapshot throughout the preview
106
+ session. Additions are green, deletions are red and struck through, and
107
+ unchanged content is muted. Renames share one box; date, status, and
108
+ dependency changes are annotated. Navigation, filters, and reloads retain
109
+ the baseline, whose reference and commit appear below the graph.
110
+ Comparison uses the same repository-relative YAML path; a file absent
111
+ from the revision is treated as an empty plan. Historical file renames
112
+ are not followed, and comparison markup is never written to YAML.
101
113
  - `pydifft tex2qmd file.tex` converts LaTeX sources to Quarto markdown.
102
114
  The converter preserves custom observation blocks and errata tags while
103
115
  translating verbatim/python environments into fenced code blocks so the
@@ -108,10 +120,32 @@ included are (listed in order of fun/utility):
108
120
  ``_build``/``_display`` directories; with ``--watch`` it starts the HTTP
109
121
  server and automatically rebuilds the staged fragments whenever you edit
110
122
  a ``.qmd`` file.
111
- - `pydifft gd [git diff args...]` shows the same Qt review table as the old
123
+ - ``pydifft tree`` (or ``git tree`` with the alias installed) opens the last
124
+ 40 commits across all branches, in Git date order. Use the down arrow
125
+ below the history to add the next 40 commits. Colors follow
126
+ first-parent ancestry; merged branches join the receiving branch.
127
+ Tags and branch tips have vector icon badges; hashes appear on hover.
128
+ Click any part of a commit row
129
+ to compare with the working directory, or right-click to copy its hash
130
+ or set a commit as the comparison endpoint. The right-click menu can restore
131
+ the working-directory endpoint. Diff window titles show the equivalent
132
+ arguments, preferring tags, then branch names, then six-character hashes.
133
+ Run ``pydifft tree --install`` to add the matching ``git tree`` alias.
134
+ - ``pydifft gd`` (or ``git gd`` with the alias installed) reviews unstaged
135
+ changes, like bare ``git diff``.
136
+ ``pydifft gd [git diff args...]`` shows the same Qt review table as the old
112
137
  ``git_gd_qt.py`` helper before launching ``git difftool`` for a selected
113
- file. Run ``pydifft gd --install`` to add the matching ``git gd`` alias
114
- to your global git config.
138
+ file.
139
+ Image rows are scored in the background and displayed as normalized
140
+ ``rgb X.X a X.X`` RMS changes; RGB change orders the image rows as scores
141
+ arrive.
142
+ Raster images open in a Qt viewer that aligns the old and new image,
143
+ displays their RGB difference, and uses up/down controls to switch
144
+ among the original, difference, and aligned new image. Images with an
145
+ alpha channel are displayed over a checkerboard; when transparency
146
+ changes, an additional red/blue alpha-difference view is included.
147
+ Run ``pydifft gd --install`` to add the matching ``git gd`` alias to
148
+ your global git config.
115
149
  - `pydifft qmdinit [directory]` scaffolds a new Quarto-style project using
116
150
  the bundled templates and example ``project1`` hierarchy, then downloads
117
151
  MathJax into ``_template/mathjax`` so the builder can run immediately.
@@ -122,12 +156,20 @@ included are (listed in order of fun/utility):
122
156
  wrapping, ideal for when you are
123
157
  working on manuscripts that you
124
158
  are version tracking with git.
159
+ Headers, fenced code blocks, and Pandoc tables retain their formatting.
160
+ Display-math delimiters get their own lines while equation contents retain
161
+ their wrapping; inline-math boundaries are preferred places to wrap prose.
125
162
  - `pydifft wmatch` ("whitespace match"): a script that matches whitespace between two text files.
126
163
 
127
164
  * pandoc can convert between markdown/latex/word, but doing this messes with your whitespace and gvimdiff comparisons.
128
165
 
129
166
  * this allows you to use an original file with good whitespace formatting as a "template" that you can match other (e.g. pandoc converted file) onto another
130
167
 
168
+ * changed prose lines exceeding 1.5 times the nearby reference width are
169
+ wrapped using the same sentence and punctuation rules as ``wr``.
170
+ Existing surrounding line breaks are retained; the fallback width is
171
+ 80 columns when the reference provides too little prose.
172
+
131
173
  - `pydifft wd` ("word diff"): generate "track changes" word files starting from pandoc markdown in a git history. Assuming that you have copied diff-doc.js (copied + licensed from elsewhere) into your home directory, this will use pandoc to convert the markdown files to MS Word, then use the MS Word comparison tool to generate a document where all relevant changes are shown with "track changes."
132
174
 
133
175
  * by default, this uses the file `template.docx` in the current directory as a pandoc word template
@@ -59,7 +59,10 @@ pydifftools/continuous.py
59
59
  pydifftools/copy_files.py
60
60
  pydifftools/diff-doc.js
61
61
  pydifftools/doc_contents.py
62
+ pydifftools/forward_search.py
62
63
  pydifftools/git_gd.py
64
+ pydifftools/git_gd_history.py
65
+ pydifftools/git_gd_image.py
63
66
  pydifftools/git_gd_qt.py
64
67
  pydifftools/html_comments.py
65
68
  pydifftools/html_uncomments.py
@@ -77,6 +80,7 @@ pydifftools/update_check.py
77
80
  pydifftools/wrap_sentences.py
78
81
  pydifftools/xml2xlsx.vbs
79
82
  pydifftools/flowchart/__init__.py
83
+ pydifftools/flowchart/comparison.py
80
84
  pydifftools/flowchart/dot_to_yaml.py
81
85
  pydifftools/flowchart/graph.py
82
86
  pydifftools/flowchart/watch_graph.py
@@ -85,8 +89,15 @@ pydifftools/notebook/display.py
85
89
  pydifftools/notebook/fast_build.py
86
90
  pydifftools/notebook/tex_to_qmd.py
87
91
  tests/test_browser_lifecycle.py
92
+ tests/test_check_single_use.py
88
93
  tests/test_command_line_help.py
89
94
  tests/test_continuous_shutdown.py
95
+ tests/test_forward_search.py
96
+ tests/test_git_gd_history.py
97
+ tests/test_git_gd_image.py
98
+ tests/test_git_gd_qt.py
90
99
  tests/test_rrng.py
91
100
  tests/test_tex_to_qmd.py
92
- tests/test_update_check.py
101
+ tests/test_update_check.py
102
+ tests/test_wrap_check.py
103
+ tests/test_wrapping.py
@@ -1,3 +1,5 @@
1
+ numpy
2
+ Pillow
1
3
  selenium
2
4
  fuzzywuzzy[speedup]
3
5
  PyYAML>=6.0
@@ -12,3 +14,4 @@ nbconvert
12
14
  pygments
13
15
  ansi2html
14
16
  lxml
17
+ PySide6
@@ -10,7 +10,6 @@ import re
10
10
  import nbformat
11
11
  import difflib
12
12
  import shutil
13
- import socket
14
13
  import importlib.util
15
14
  from pathlib import Path
16
15
  from . import (
@@ -20,7 +19,15 @@ from . import (
20
19
  update_check,
21
20
  )
22
21
  from .continuous import cpb, FORWARD_SEARCH_HOST, FORWARD_SEARCH_PORT
22
+ from .forward_search import (
23
+ ForwardSearchProtocolError,
24
+ ForwardSearchUnavailable,
25
+ send_forward_search,
26
+ )
23
27
  from .wrap_sentences import wr as wrap_sentences_wr # registers wrap command
28
+ from .wrap_sentences import ( # registers wrchk command
29
+ wrchk as wrap_sentences_wrchk,
30
+ )
24
31
  from .separate_comments import tex_sepcomments
25
32
  from .unseparate_comments import tex_unsepcomments
26
33
  from .comment_functions import matchingbrackets
@@ -356,7 +363,10 @@ def gvr(arguments):
356
363
  subprocess.Popen(" ".join(cmd))
357
364
 
358
365
 
359
- @register_command("match whitespace")
366
+ @register_command(
367
+ "match whitespace",
368
+ filename_extensions={"arguments": [".md", ".tex"]},
369
+ )
360
370
  def wmatch(arguments):
361
371
  match_spaces.run(arguments)
362
372
 
@@ -530,7 +540,21 @@ def mfs(text):
530
540
  if marker_match:
531
541
  search_text = search_text[: marker_match.start()]
532
542
  search_text = re.sub(r"\[@[^\]]+\]", " ", search_text)
533
- search_text = search_text.replace("**", " ").replace("*", " ")
543
+ # Strip paired markup delimiters (bold/italic, strikethrough,
544
+ # superscript/subscript). These delimiters hug the text they wrap with no
545
+ # space in the rendered output (e.g. "x^2^" renders as "x2"), so they are
546
+ # dropped rather than replaced with a space. Plain str.replace is used
547
+ # (not regex) so this is linear time regardless of how many delimiter
548
+ # characters appear.
549
+ search_text = (
550
+ search_text.replace("**", "")
551
+ .replace("__", "")
552
+ .replace("~~", "")
553
+ .replace("*", "")
554
+ .replace("_", "")
555
+ .replace("~", "")
556
+ .replace("^", "")
557
+ )
534
558
  search_text = re.sub(r"\s+", " ", search_text).strip()
535
559
  if not search_text:
536
560
  search_text = text.strip()
@@ -540,16 +564,27 @@ def mfs(text):
540
564
  (FORWARD_SEARCH_HOST, FORWARD_SEARCH_PORT),
541
565
  (QMDB_FORWARD_SEARCH_HOST, QMDB_FORWARD_SEARCH_PORT),
542
566
  ]
543
- client = None
544
- for address in socket_addresses:
545
- candidate = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
546
- try:
547
- candidate.connect(address)
548
- client = candidate
549
- break
550
- except OSError:
551
- candidate.close()
552
- if client is None:
567
+
568
+ def try_existing_listener():
569
+ protocol_errors = []
570
+ for address in socket_addresses:
571
+ try:
572
+ send_forward_search(address, search_text)
573
+ except ForwardSearchUnavailable:
574
+ continue
575
+ except ForwardSearchProtocolError as exc:
576
+ protocol_errors.append(str(exc))
577
+ continue
578
+ return True
579
+ if protocol_errors:
580
+ raise RuntimeError(
581
+ "A forward-search port accepted the connection but did not "
582
+ "acknowledge the pydifft protocol. Refusing to open another "
583
+ "browser window.\n" + "\n".join(protocol_errors)
584
+ )
585
+ return False
586
+
587
+ if not try_existing_listener():
553
588
  # If no listener is running yet, choose a markdown file in this
554
589
  # directory that contains the requested search text and start cpb for
555
590
  # it.
@@ -581,24 +616,14 @@ def mfs(text):
581
616
  # Wait up to 20 seconds so the child can bring up the listener,
582
617
  # then resend the forward-search text.
583
618
  for _ in range(80):
584
- for address in socket_addresses:
585
- candidate = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
586
- try:
587
- candidate.connect(address)
588
- client = candidate
589
- break
590
- except OSError:
591
- candidate.close()
592
- if client is not None:
593
- break
619
+ if try_existing_listener():
620
+ return
594
621
  time.sleep(0.25)
595
622
  else:
596
623
  raise RuntimeError(
597
- "Started cpb automatically, but the forward search socket "
598
- "did not come up within 20 seconds."
624
+ "Started cpb automatically, but no acknowledged forward "
625
+ "search endpoint came up within 20 seconds."
599
626
  )
600
- client.sendall(search_text.encode("utf-8"))
601
- client.close()
602
627
 
603
628
 
604
629
  @register_command("Convert xml to xlsx")