skilleter-thingy 0.0.61__py3-none-any.whl → 0.0.63__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.
Potentially problematic release.
This version of skilleter-thingy might be problematic. Click here for more details.
- skilleter_thingy/readable.py +35 -7
- skilleter_thingy/thingy/tidy.py +2 -2
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/METADATA +2 -2
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/RECORD +8 -8
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/LICENSE +0 -0
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/WHEEL +0 -0
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/entry_points.txt +0 -0
- {skilleter_thingy-0.0.61.dist-info → skilleter_thingy-0.0.63.dist-info}/top_level.txt +0 -0
skilleter_thingy/readable.py
CHANGED
|
@@ -31,6 +31,7 @@ TF_IGNORE_MSG = 'Unless you have made equivalent changes to your configuration,
|
|
|
31
31
|
|
|
32
32
|
TF_REFRESHING_AND_READING = re.compile(r'.*: (?:Refreshing state\.\.\.|Reading\.\.\.|Still reading\.\.\.|Read complete after |Preparing import\.\.\.).*')
|
|
33
33
|
TF_FINDING_AND_INSTALLING = re.compile(r'- (?:Finding .*[.]{3}|Installing .*[.]{3}|Installed .*)')
|
|
34
|
+
TF_FETCHING_AND_INSTALLING = re.compile(r'(Fetching|Installing|Using) [-a-z0-9_]+ [0-9.]+')
|
|
34
35
|
|
|
35
36
|
TF_UNCHANGED_HIDDEN = re.compile(r' +# \(\d+ unchanged (?:attribute|block|element)s? hidden\)')
|
|
36
37
|
|
|
@@ -40,16 +41,23 @@ TF_HAS_CHANGED_END = re.compile(r' [}]')
|
|
|
40
41
|
TF_READ_DURING_APPLY = re.compile(r' +# [-a-z_.0-9\[\]]+ will be read during apply')
|
|
41
42
|
TF_READ_DURING_APPLY_END = re.compile(r' [}]')
|
|
42
43
|
|
|
44
|
+
TF_TAG_CHANGE_BLOCK_START = re.compile(r'^ +~ +tags(_all)? += +\{$')
|
|
45
|
+
TF_TAG_ENTRY_IGNORE = re.compile(r'^ +".*" += +".*"')
|
|
46
|
+
TF_TAG_CHANGE_BLOCK_END = re.compile(r'^ +}$')
|
|
47
|
+
|
|
43
48
|
TF_MISC_REGEX = \
|
|
44
49
|
[
|
|
45
|
-
{ 'regex': re.compile(r'(Read complete after) \d+s'), 'replace': r'\1 {
|
|
50
|
+
{ 'regex': re.compile(r'(Read complete after) (\d+s|\d+m\d+s)'), 'replace': r'\1 {ELAPSED}'},
|
|
46
51
|
{ 'regex': re.compile(r'"(.*:.*)"( = ".*")'), 'replace': r'\1\2'},
|
|
47
52
|
{ 'regex': re.compile(r'"(.*:.*)"( = \[$)'), 'replace': r'\1\2'},
|
|
53
|
+
{ 'regex': re.compile(r'^last "terraform apply":$'), 'replace':r'last "terraform apply" which may have affected this plan:'},
|
|
48
54
|
]
|
|
49
55
|
|
|
50
56
|
TF_IGNORE_LIST = [
|
|
51
57
|
{'start': TF_HAS_CHANGED, 'end': TF_HAS_CHANGED_END},
|
|
52
58
|
{'start': TF_READ_DURING_APPLY, 'end': TF_READ_DURING_APPLY_END},
|
|
59
|
+
{'start': re.compile(r'(Releasing|Acquiring) state lock. This may take a few moments\.+')},
|
|
60
|
+
{'start': re.compile(r'.*: Still reading\.{3} \[.* elapsed\]')},
|
|
53
61
|
]
|
|
54
62
|
|
|
55
63
|
################################################################################
|
|
@@ -142,6 +150,10 @@ def cleanfile(args, infile, outfile):
|
|
|
142
150
|
|
|
143
151
|
collection = []
|
|
144
152
|
|
|
153
|
+
# True if we are processing a tag block
|
|
154
|
+
|
|
155
|
+
in_tag_block = False
|
|
156
|
+
|
|
145
157
|
# Read, process and write stdin to stdout, converting appropriately
|
|
146
158
|
|
|
147
159
|
for data in infile:
|
|
@@ -196,22 +208,31 @@ def cleanfile(args, infile, outfile):
|
|
|
196
208
|
|
|
197
209
|
for ignore in TF_IGNORE_LIST:
|
|
198
210
|
if ignore['start'].fullmatch(clean):
|
|
199
|
-
|
|
211
|
+
if 'end' in ignore:
|
|
212
|
+
ignore_until = ignore['end']
|
|
213
|
+
|
|
214
|
+
logging.info('Found ignore start marker: "%s"', clean)
|
|
215
|
+
logging.info('Skipping until end marker: "%s"', ignore_until.pattern)
|
|
216
|
+
else:
|
|
217
|
+
clean = None
|
|
200
218
|
|
|
201
|
-
logging.info('Found ignore start marker: "%s"', clean)
|
|
202
|
-
logging.info('Skipping until end marker: "%s"', ignore_until.pattern)
|
|
203
219
|
break
|
|
204
220
|
else:
|
|
205
|
-
if
|
|
221
|
+
if TF_TAG_CHANGE_BLOCK_START.fullmatch(clean):
|
|
222
|
+
in_tag_block = True
|
|
223
|
+
|
|
224
|
+
elif TF_TAG_CHANGE_BLOCK_END.fullmatch(clean):
|
|
225
|
+
in_tag_block = False
|
|
226
|
+
|
|
227
|
+
elif TF_UNCHANGED_HIDDEN.fullmatch(clean):
|
|
206
228
|
clean = None
|
|
207
229
|
|
|
208
230
|
elif clean == TF_IGNORE_MSG:
|
|
209
231
|
clean = None
|
|
210
232
|
|
|
211
|
-
elif TF_REFRESHING_AND_READING.match(clean) or TF_FINDING_AND_INSTALLING.fullmatch(clean):
|
|
233
|
+
elif TF_REFRESHING_AND_READING.match(clean) or TF_FINDING_AND_INSTALLING.fullmatch(clean) or TF_FETCHING_AND_INSTALLING.fullmatch(clean):
|
|
212
234
|
# Collect a block of non-deterministically-ordered data
|
|
213
235
|
|
|
214
|
-
logging.info('Adding "%s" to collection', clean)
|
|
215
236
|
collection.append(clean)
|
|
216
237
|
clean = None
|
|
217
238
|
|
|
@@ -227,6 +248,9 @@ def cleanfile(args, infile, outfile):
|
|
|
227
248
|
|
|
228
249
|
collection = []
|
|
229
250
|
|
|
251
|
+
if in_tag_block and clean and TF_TAG_ENTRY_IGNORE.fullmatch(clean):
|
|
252
|
+
clean = None
|
|
253
|
+
|
|
230
254
|
# Write normal output, skipping >1 blank lines
|
|
231
255
|
|
|
232
256
|
if clean is not None and not ignore_until:
|
|
@@ -248,6 +272,10 @@ def cleanfile(args, infile, outfile):
|
|
|
248
272
|
print(f'INTERNAL ERROR: Code never found end of ignore-block marker "{ignore_until.pattern}" - either the Terraform output format has changed, or the log file is incomplete!')
|
|
249
273
|
sys.exit(2)
|
|
250
274
|
|
|
275
|
+
if in_tag_block:
|
|
276
|
+
print('INTERNAL ERROR: Code never found end of tag block marker - either the Terraform output format has changed, or the log file is incomplete!')
|
|
277
|
+
sys.exit(2)
|
|
278
|
+
|
|
251
279
|
################################################################################
|
|
252
280
|
|
|
253
281
|
def main():
|
skilleter_thingy/thingy/tidy.py
CHANGED
|
@@ -58,8 +58,8 @@ RE_TIME = [
|
|
|
58
58
|
|
|
59
59
|
{'regex': re.compile(r'[0-9]([.][0-9]*)*\s*(second[s]?)'), 'replace': '{ELAPSED}'},
|
|
60
60
|
|
|
61
|
-
{'find':
|
|
62
|
-
{'
|
|
61
|
+
{'find': '\{DATE\} \{TIME\}', 'replace': '{DATE+TIME}'},
|
|
62
|
+
{'regex': re.compile(r'[0-9]+m *[0-9]+s'), 'replace': '{ELAPSED}'},
|
|
63
63
|
]
|
|
64
64
|
|
|
65
65
|
# SHA values
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.63
|
|
4
4
|
Summary: A collection of useful utilities, mainly aimed at making Git more friendly
|
|
5
5
|
Author-email: John Skilleter <john@skilleter.org.uk>
|
|
6
6
|
Project-URL: Home, https://skilleter.org.uk
|
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
|
8
8
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
13
|
Requires-Dist: imagehash
|
|
@@ -28,7 +28,7 @@ skilleter_thingy/moviemover.py,sha256=j_Xb9_jFdgpFBAXcF4tEqbnKH_FonlnUU39LiCK980
|
|
|
28
28
|
skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
|
|
29
29
|
skilleter_thingy/phototidier.py,sha256=5gSjlINUxf3ZQl3NG0o7CsWwODvTbokIMIafLFvn8Hc,7818
|
|
30
30
|
skilleter_thingy/py_audit.py,sha256=xJm5k5qyeA6ii8mODa4dOkmP8L1drv94UHuxR54RsIM,4384
|
|
31
|
-
skilleter_thingy/readable.py,sha256=
|
|
31
|
+
skilleter_thingy/readable.py,sha256=urBwbhs12ckBQa_mj2InbhQWFsKxs9irFOLTiJ8QdTE,13066
|
|
32
32
|
skilleter_thingy/remdir.py,sha256=SkN9xEc1ckFGRP4zS2LUbx7Ihw697YMV0ybr_-afiyE,4653
|
|
33
33
|
skilleter_thingy/rmdupe.py,sha256=tcX3w8XvliGwBMdSt9BUu07kuDtQEc0IiU8sCxmgzHA,17117
|
|
34
34
|
skilleter_thingy/rpylint.py,sha256=TzZ5GvWrqgTKYKZwadTvzdbX-DJ8ll4WfVJqtN6IzO0,2635
|
|
@@ -58,11 +58,11 @@ skilleter_thingy/thingy/popup.py,sha256=jW-nbpdeswqEMTli7OmBv1J8XQsvFoMI0J33O6dO
|
|
|
58
58
|
skilleter_thingy/thingy/process.py,sha256=WJLg3js1zdgI7Nlkt7e5ICltkjXcA9P1f-LWPSZCdWs,3570
|
|
59
59
|
skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1Uo,12611
|
|
60
60
|
skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
|
|
61
|
-
skilleter_thingy/thingy/tidy.py,sha256=
|
|
61
|
+
skilleter_thingy/thingy/tidy.py,sha256=71DCyj0VJrj52RmjQyj1eOiQJIfy5EIPHuThOrS6ZTA,5876
|
|
62
62
|
skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
|
|
63
|
-
skilleter_thingy-0.0.
|
|
64
|
-
skilleter_thingy-0.0.
|
|
65
|
-
skilleter_thingy-0.0.
|
|
66
|
-
skilleter_thingy-0.0.
|
|
67
|
-
skilleter_thingy-0.0.
|
|
68
|
-
skilleter_thingy-0.0.
|
|
63
|
+
skilleter_thingy-0.0.63.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
|
|
64
|
+
skilleter_thingy-0.0.63.dist-info/METADATA,sha256=hrDs-f3Z4kaE9XUcRT9F9RgJ43s-RBhc8qtt4hXSstY,5313
|
|
65
|
+
skilleter_thingy-0.0.63.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
66
|
+
skilleter_thingy-0.0.63.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
|
|
67
|
+
skilleter_thingy-0.0.63.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
|
|
68
|
+
skilleter_thingy-0.0.63.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|