skilleter-thingy 0.0.66__py3-none-any.whl → 0.0.68__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/ggit.py +1 -3
- skilleter_thingy/readable.py +28 -13
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/METADATA +2 -2
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/RECORD +8 -8
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/WHEEL +1 -1
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/LICENSE +0 -0
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/entry_points.txt +0 -0
- {skilleter_thingy-0.0.66.dist-info → skilleter_thingy-0.0.68.dist-info}/top_level.txt +0 -0
skilleter_thingy/ggit.py
CHANGED
|
@@ -16,9 +16,7 @@ def run_git(args, directory, command):
|
|
|
16
16
|
""" Run a git command in the specified directory """
|
|
17
17
|
|
|
18
18
|
if not args.quiet:
|
|
19
|
-
|
|
20
|
-
print('Running git %s in %s' % (' '.join(command), directory))
|
|
21
|
-
print('-' * 80)
|
|
19
|
+
colour.write('\n[BOLD][GREEN:Running git %s in %s][NORMAL]\n' % (' '.join(command), directory))
|
|
22
20
|
|
|
23
21
|
sys.stdout.flush()
|
|
24
22
|
|
skilleter_thingy/readable.py
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
# TODO: Not sure it works properly as a pipe
|
|
12
12
|
# TODO: Error handling in file I/O
|
|
13
|
+
# TODO: Ability to remove Terraform 'will be read during apply' blocks (remove from '^ <= .* \{' to ^ \}$')
|
|
13
14
|
|
|
14
15
|
################################################################################
|
|
15
16
|
|
|
@@ -68,19 +69,20 @@ def parse_command_line():
|
|
|
68
69
|
|
|
69
70
|
parser = argparse.ArgumentParser(description='Read from standard input and write to standard output modifying ANSI colour codes en-route.')
|
|
70
71
|
|
|
71
|
-
parser.add_argument('
|
|
72
|
-
parser.add_argument('
|
|
73
|
-
parser.add_argument('
|
|
74
|
-
parser.add_argument('
|
|
72
|
+
parser.add_argument('--light', '-l', action='store_true', help='Modify colours for a light background (the default)')
|
|
73
|
+
parser.add_argument('--dark', '-d', action='store_true', help='Modify colours for a dark background')
|
|
74
|
+
parser.add_argument('--none', '-n', action='store_true', help='Remove all colour codes')
|
|
75
|
+
parser.add_argument('--tidy', '-t', action='store_true',
|
|
75
76
|
help='Remove colour codes and stuff that typically occurs in log files causing diffs, but is of no particular interest (e.g. SHA1 values, times, dates)')
|
|
76
|
-
parser.add_argument('-
|
|
77
|
-
parser.add_argument('
|
|
78
|
-
parser.add_argument('
|
|
79
|
-
parser.add_argument('
|
|
80
|
-
parser.add_argument('
|
|
81
|
-
parser.add_argument('
|
|
82
|
-
parser.add_argument('
|
|
83
|
-
parser.add_argument('
|
|
77
|
+
parser.add_argument('--strip-blank', '-s', action='store_true', help='Strip all blank lines')
|
|
78
|
+
parser.add_argument('--debug', '-D', action='store_true', help='Replace colours with debug information')
|
|
79
|
+
parser.add_argument('--out', '-o', action='store_true', help='Output to standard output rather than overwriting input files')
|
|
80
|
+
parser.add_argument('--dir', '-O', action='store', default=None, help='Store output files in the specified directory (creating it if it doesn\'t exist)')
|
|
81
|
+
parser.add_argument('--aws', '-a', action='store_true', help='Remove AWS resource IDs')
|
|
82
|
+
parser.add_argument('--terraform', '-T', action='store_true', help='Clean Terraform plan/apply log files')
|
|
83
|
+
parser.add_argument('--replace', '-R', action='append', default=None, help='Additional regex replacements in the form "REGEX=REPLACEMENT"')
|
|
84
|
+
parser.add_argument('--verbose', '-v', action='store_true', help='Output verbose status')
|
|
85
|
+
parser.add_argument('--minimal', '-m', action='store_true', help='Remove unnecessary data from the file (e.g. Terraform progress updates (Refreshing..., Reading..., etc.))')
|
|
84
86
|
parser.add_argument('files', nargs='*', default=None, help='The files to convert (use stdin/stout if no input files are specified)')
|
|
85
87
|
|
|
86
88
|
args = parser.parse_args()
|
|
@@ -206,9 +208,16 @@ def cleanfile(args, infile, outfile):
|
|
|
206
208
|
for entry in args.regex_replace:
|
|
207
209
|
clean = entry['regex'].sub(entry['replace'], clean)
|
|
208
210
|
|
|
211
|
+
# Additional cleanup - remove 'noise' from the output (currently just TF-related).
|
|
212
|
+
|
|
213
|
+
if args.minimal:
|
|
214
|
+
if args.terraform:
|
|
215
|
+
if TF_REFRESHING_AND_READING.match(clean):
|
|
216
|
+
clean = None
|
|
217
|
+
|
|
209
218
|
# Do things with Terraform log data
|
|
210
219
|
|
|
211
|
-
if args.terraform:
|
|
220
|
+
if clean and args.terraform:
|
|
212
221
|
clean = tidy.regex_replace(clean, TF_MISC_REGEX)
|
|
213
222
|
|
|
214
223
|
for ignore in TF_IGNORE_LIST:
|
|
@@ -332,12 +341,16 @@ def main():
|
|
|
332
341
|
if args.dir:
|
|
333
342
|
# Writing to a directory - just move the output file there unconditionally
|
|
334
343
|
|
|
344
|
+
logging.info('Writing %s to %s', outfile_name, args.dir)
|
|
345
|
+
|
|
335
346
|
shutil.move(outfile_name, os.path.join(args.dir, os.path.basename(filename)))
|
|
336
347
|
|
|
337
348
|
elif not filecmp.cmp(outfile_name, filename, shallow=False):
|
|
338
349
|
# Only backup and write the source file if changes have been made (original is
|
|
339
350
|
# left in place without a backup if nothing's changed)
|
|
340
351
|
|
|
352
|
+
logging.info('Backing up old file and writing new %s', outfile_name)
|
|
353
|
+
|
|
341
354
|
files.backup(filename)
|
|
342
355
|
|
|
343
356
|
shutil.move(outfile_name, filename)
|
|
@@ -345,6 +358,8 @@ def main():
|
|
|
345
358
|
else:
|
|
346
359
|
# Output file hasn't been used, so just delete it
|
|
347
360
|
|
|
361
|
+
logging.info('No changes made to %s', outfile_name)
|
|
362
|
+
|
|
348
363
|
os.unlink(outfile_name)
|
|
349
364
|
|
|
350
365
|
except FileNotFoundError as exc:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.68
|
|
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
|
|
@@ -6,7 +6,7 @@ skilleter_thingy/console_colours.py,sha256=BOS9mo3jChx_FE8L1j488MDoVNgib11KjTRhr
|
|
|
6
6
|
skilleter_thingy/diskspacecheck.py,sha256=7xsj4egXXV6jPhXZTe2b5rS03XAmm5uLC5TeiO1NJoE,2072
|
|
7
7
|
skilleter_thingy/docker_purge.py,sha256=Qsykf_xR9ekn2u5n0ZNK84jMJbp08CilcCw1EAZKX2I,3307
|
|
8
8
|
skilleter_thingy/ffind.py,sha256=XJwH27rTLI0-zGD-7s8viyg7_SZjJaq5Q7VBbJPSYSI,19235
|
|
9
|
-
skilleter_thingy/ggit.py,sha256=
|
|
9
|
+
skilleter_thingy/ggit.py,sha256=VW1SgNug0Gr_t_BhinHxJSN0hL7UT-5_lAKuImWrZJM,2465
|
|
10
10
|
skilleter_thingy/ggrep.py,sha256=Mxme8gliQms9-_uf7CLqD9Zd3ZAVFWjamsK6dWw58jg,5863
|
|
11
11
|
skilleter_thingy/git_br.py,sha256=NUCqe85VCgouzEpbMVODaScPIsbCrC4pe7zDMDz02Ro,5799
|
|
12
12
|
skilleter_thingy/git_ca.py,sha256=wzYFaQmT1MyOF-Caz0daAUv7OUvrNKCyemIWMEBW-dA,4944
|
|
@@ -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=0rwqS2kAJfw_uyl7h9d0ucqHYqrI61sM_7cZz_SFktY,14738
|
|
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
|
|
@@ -60,9 +60,9 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
|
|
|
60
60
|
skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
|
|
61
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.68.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
|
|
64
|
+
skilleter_thingy-0.0.68.dist-info/METADATA,sha256=Jz03ABA0JmvYxJ7GiKQJ4J3pYwtxzz1F5qQi_DTiIiU,5313
|
|
65
|
+
skilleter_thingy-0.0.68.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
66
|
+
skilleter_thingy-0.0.68.dist-info/entry_points.txt,sha256=LxYRrQHkCGK-zjLXHqRdsUSUOoBbh7e8YUN1IVs5vIs,2072
|
|
67
|
+
skilleter_thingy-0.0.68.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
|
|
68
|
+
skilleter_thingy-0.0.68.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|