pyDiffTools 0.1.6__py3-none-any.whl
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/__init__.py +10 -0
- pydifftools/check_numbers.py +55 -0
- pydifftools/command_line.py +818 -0
- pydifftools/comment_functions.py +39 -0
- pydifftools/continuous.py +166 -0
- pydifftools/copy_files.py +75 -0
- pydifftools/diff-doc.js +193 -0
- pydifftools/doc_contents.py +107 -0
- pydifftools/html_comments.py +33 -0
- pydifftools/html_uncomments.py +524 -0
- pydifftools/match_spaces.py +235 -0
- pydifftools/onewordify.py +149 -0
- pydifftools/onewordify_undo.py +54 -0
- pydifftools/outline.py +68 -0
- pydifftools/rearrange_tex.py +188 -0
- pydifftools/searchacro.py +80 -0
- pydifftools/separate_comments.py +77 -0
- pydifftools/split_conflict.py +213 -0
- pydifftools/unseparate_comments.py +72 -0
- pydifftools/wrap_sentences.py +516 -0
- pydifftools/xml2xlsx.vbs +33 -0
- pydifftools-0.1.6.dist-info/METADATA +117 -0
- pydifftools-0.1.6.dist-info/RECORD +27 -0
- pydifftools-0.1.6.dist-info/WHEEL +5 -0
- pydifftools-0.1.6.dist-info/entry_points.txt +2 -0
- pydifftools-0.1.6.dist-info/licenses/LICENSE.md +28 -0
- pydifftools-0.1.6.dist-info/top_level.txt +1 -0
pydifftools/__init__.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from subprocess import Popen, PIPE
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def run(arguments):
|
|
6
|
+
try:
|
|
7
|
+
start, stop = list(map(int, arguments))
|
|
8
|
+
except:
|
|
9
|
+
raise ValueError("I didn't understand the arguments" + repr(arguments))
|
|
10
|
+
for thisnumber in range(start, stop + 1):
|
|
11
|
+
if os.name == "posix":
|
|
12
|
+
result = Popen(
|
|
13
|
+
[r'grep -Rice "%d\." ~/notebook/list*' % thisnumber],
|
|
14
|
+
shell=True,
|
|
15
|
+
stdout=PIPE,
|
|
16
|
+
)
|
|
17
|
+
else:
|
|
18
|
+
try:
|
|
19
|
+
result = Popen(
|
|
20
|
+
[
|
|
21
|
+
r"C:\Program Files\Git\bin\bash.exe",
|
|
22
|
+
"-c",
|
|
23
|
+
r'grep -rice "%d\." ~/notebook/list*' % thisnumber,
|
|
24
|
+
],
|
|
25
|
+
stdout=PIPE,
|
|
26
|
+
)
|
|
27
|
+
except:
|
|
28
|
+
result = Popen(
|
|
29
|
+
[
|
|
30
|
+
r"C:\Program Files (x86)\Git\bin\bash.exe",
|
|
31
|
+
"-c",
|
|
32
|
+
r'grep -rice "%d\." ~/notebook/list*' % thisnumber,
|
|
33
|
+
],
|
|
34
|
+
stdout=PIPE,
|
|
35
|
+
)
|
|
36
|
+
matched_already = False
|
|
37
|
+
matched_multiple = False
|
|
38
|
+
full_string = []
|
|
39
|
+
for thisline in result.stdout.readlines():
|
|
40
|
+
if (not thisline.find(":0") > -1) and thisline.find(".tex:") > -1:
|
|
41
|
+
if not matched_already:
|
|
42
|
+
print(thisnumber, " ", end=" ")
|
|
43
|
+
if not thisline.find(":1") > -1:
|
|
44
|
+
matched_already = True
|
|
45
|
+
full_string.append(thisline.strip())
|
|
46
|
+
if matched_already: # more than one match
|
|
47
|
+
print("conflicting files:")
|
|
48
|
+
print("\n".join(full_string))
|
|
49
|
+
matched_multiple = True
|
|
50
|
+
matched_already = True
|
|
51
|
+
if not matched_multiple:
|
|
52
|
+
if matched_already:
|
|
53
|
+
print("single\t\t", full_string[-1][:-2])
|
|
54
|
+
else:
|
|
55
|
+
print(thisnumber, " has no match")
|