skilleter-thingy 0.0.68__py3-none-any.whl → 0.0.69__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.

@@ -64,6 +64,14 @@ TF_IGNORE_LIST = [
64
64
 
65
65
  ################################################################################
66
66
 
67
+ def error(msg):
68
+ """ Report an error and quit """
69
+
70
+ sys.stderr.write(f'{msg}\n')
71
+ sys.exit(1)
72
+
73
+ ################################################################################
74
+
67
75
  def parse_command_line():
68
76
  """ Parse, check and sanitise the command line arguments """
69
77
 
@@ -83,6 +91,7 @@ def parse_command_line():
83
91
  parser.add_argument('--replace', '-R', action='append', default=None, help='Additional regex replacements in the form "REGEX=REPLACEMENT"')
84
92
  parser.add_argument('--verbose', '-v', action='store_true', help='Output verbose status')
85
93
  parser.add_argument('--minimal', '-m', action='store_true', help='Remove unnecessary data from the file (e.g. Terraform progress updates (Refreshing..., Reading..., etc.))')
94
+ parser.add_argument('--non-minimal', '-M', action='store_true', help='Do not remove unnecessary data from the file (e.g. Terraform progress updates (Refreshing..., Reading..., etc.))')
86
95
  parser.add_argument('files', nargs='*', default=None, help='The files to convert (use stdin/stout if no input files are specified)')
87
96
 
88
97
  args = parser.parse_args()
@@ -96,23 +105,29 @@ def parse_command_line():
96
105
  # Can't do more than one transformation
97
106
 
98
107
  if args.light + args.dark + args.none + args.debug > 1:
99
- print('ERROR: Only one colour conversion option can be specified')
100
- sys.exit(1)
108
+ error('ERROR: Only one colour conversion option can be specified')
101
109
 
102
110
  if args.tidy and (args.light or args.dark or args.debug):
103
- print('ERROR: The tidy and colour conversion options cannot be specified together')
104
- sys.exit(1)
111
+ error('ERROR: The tidy and colour conversion options cannot be specified together')
112
+
113
+ if args.minimal and args.non_minimal:
114
+ error('ERROR: Cannot use minimal and non-minimal options together')
105
115
 
106
- # Default to doing cleanup - removing colour codes, times & Terraform cleanup
116
+ # Default to doing cleanup - removing colour codes, times & Terraform & minimal cleanup
107
117
 
108
- if not args.light and not args.dark and not args.tidy and not args.strip_blank and not args.terraform:
109
- args.strip_blank = args.none = args.tidy = args.terraform = True
110
- logging.info('No options specified - defaulting to stripping blanks, removing colour codes, tidying and cleaning Terraform data')
118
+ if not args.light and not args.dark and not args.tidy and not args.strip_blank and not args.terraform and not args.minimal and not args.non_minimal:
119
+ args.strip_blank = args.none = args.tidy = args.terraform = args.minimal = True
120
+ logging.info('No options specified - defaulting to stripping blanks, removing colour codes, tidying, cleaning Terraform data and removing unnecessary data')
111
121
 
112
122
  # Terraform option also removes ANSI, etc.
113
123
 
114
124
  if args.terraform:
115
- args.strip_blank = args.tidy = args.none = True
125
+ args.strip_blank = args.tidy = args.none = args.minimal = True
126
+
127
+ # Non-minimal overrides minimal
128
+
129
+ if args.non_minimal:
130
+ args.minimal = False
116
131
 
117
132
  # Create the output directory, if required
118
133
 
@@ -317,7 +332,7 @@ def main():
317
332
  if args.files:
318
333
  try:
319
334
  for filename in args.files:
320
- with open(filename, 'rt') as infile:
335
+ with open(filename, 'rt', encoding='utf8') as infile:
321
336
 
322
337
  # Either write to stdout or to a temporary file
323
338
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: skilleter_thingy
3
- Version: 0.0.68
3
+ Version: 0.0.69
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
@@ -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=0rwqS2kAJfw_uyl7h9d0ucqHYqrI61sM_7cZz_SFktY,14738
31
+ skilleter_thingy/readable.py,sha256=HR68vsm5xki6UF_p_1c6Dqsy9Yi7kW4RI-Z7qsLKor8,15414
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.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,,
63
+ skilleter_thingy-0.0.69.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
64
+ skilleter_thingy-0.0.69.dist-info/METADATA,sha256=bkdkX-7xamc-FoQaF6jy_Oko0Xc5qSEOCaIE-6FDT3c,5313
65
+ skilleter_thingy-0.0.69.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
66
+ skilleter_thingy-0.0.69.dist-info/entry_points.txt,sha256=LxYRrQHkCGK-zjLXHqRdsUSUOoBbh7e8YUN1IVs5vIs,2072
67
+ skilleter_thingy-0.0.69.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
68
+ skilleter_thingy-0.0.69.dist-info/RECORD,,