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

@@ -68,7 +68,7 @@ Sub-commands:
68
68
  {+init,+dir,+config,GIT_COMMAND}
69
69
  +init Build or update the configuration file using the current branch in each repo as the default branch
70
70
  +config Return the name and location of the configuration file
71
- +dir Return the location of a working tree, given the repo name
71
+ +dir Return the location of a working tree, given the repo name, or if no parameter specified, the root directory of the multigit tree
72
72
  GIT_COMMAND Any git command, including options and parameters - this is then run in all specified working trees
73
73
 
74
74
  """
@@ -98,7 +98,7 @@ class Arguments():
98
98
  def error(msg, status=1):
99
99
  """Quit with an error"""
100
100
 
101
- sys.stderr.write(f'{msg}\n')
101
+ colour.write(f'[RED:ERROR:] {msg}\n', stream=sys.stderr)
102
102
  sys.exit(status)
103
103
 
104
104
  ################################################################################
@@ -232,7 +232,7 @@ def mg_init(args, config, console):
232
232
  if not args.quiet:
233
233
  show_progress(console.columns, repo.name)
234
234
 
235
- if not repo in config:
235
+ if repo not in config:
236
236
  config[repo] = {
237
237
  'default branch': git.branch(path=repo)
238
238
  }
@@ -248,29 +248,33 @@ def mg_init(args, config, console):
248
248
  ################################################################################
249
249
 
250
250
  def mg_dir(args, config, console):
251
- """Return the location of a working tree, given the name. Returns an
252
- error unless there is a unique match"""
251
+ """Return the location of a working tree, given the name, or the root directory
252
+ of the tree if not
253
+ Returns an error unless there is a unique match"""
253
254
 
254
255
  # DONE: Should return location relative to the current directory or as absolute path
255
256
 
256
257
  _ = console
257
258
  _ = config
258
259
 
259
- if len(args.parameters) != 1:
260
- error('The +dir command takes one parameter - the name of the working tree to search for')
260
+ if len(args.parameters) > 1:
261
+ error('The +dir command takes no more than one parameter - the name of the working tree to search for')
262
+ elif args.parameters:
263
+ location = []
264
+ search_dir = args.parameters[0]
261
265
 
262
- location = []
266
+ for repo in select_git_repos(args, config):
267
+ if fnmatch.fnmatch(repo['name'], search_dir):
268
+ location.append(repo.name)
263
269
 
264
- for repo in select_git_repos(args, config):
265
- if fnmatch.fnmatch(repo['name'], args.parameters[0]):
266
- location.append(repo.name)
267
-
268
- if len(location) == 0:
269
- error(f'No matches with {search_dir}')
270
- elif len(location) > 1:
271
- error(f'Multiple matches with {search_dir}')
270
+ if len(location) == 0:
271
+ error(f'No matches with [BLUE:{search_dir}]')
272
+ elif len(location) > 1:
273
+ error(f'Multiple matches with [BLUE:{search_dir}] - {" ".join(location)}')
272
274
 
273
- colour.write(os.path.join(os.path.dirname(args.configuration_file), location[0]))
275
+ colour.write(os.path.join(os.path.dirname(args.configuration_file), location[0]))
276
+ else:
277
+ colour.write(os.path.dirname(args.configuration_file))
274
278
 
275
279
  ################################################################################
276
280
 
@@ -418,7 +422,9 @@ def main():
418
422
  config = configparser.ConfigParser()
419
423
 
420
424
  if not (args.internal_command and args.command == 'init'):
421
- if not os.path.isfile(args.configuration_file):
425
+ if not args.configuration_file:
426
+ error('Cannot locate configuration file')
427
+ elif not os.path.isfile(args.configuration_file):
422
428
  error(f'Cannot read configuration file {args.configuration_file}')
423
429
 
424
430
  if os.path.isfile(args.configuration_file):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: skilleter_thingy
3
- Version: 0.0.89
3
+ Version: 0.0.91
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
@@ -25,7 +25,7 @@ skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
25
25
  skilleter_thingy/gphotosync.py,sha256=Vb2zYTEFp26BYdkG810SRg9afyfDqvq4CLHTk-MFf60,22388
26
26
  skilleter_thingy/linecount.py,sha256=5voQtjJjDCVx4zjPwVRy620NpuLiwwFitzxjIsRGtxQ,4310
27
27
  skilleter_thingy/moviemover.py,sha256=j_Xb9_jFdgpFBAXcF4tEqbnKH_FonlnUU39LiCK980k,4470
28
- skilleter_thingy/multigit.py,sha256=hAMF5glefQ82_tMs-zGXj-5FGkXpytQZO5hjqjqA95M,16212
28
+ skilleter_thingy/multigit.py,sha256=Ge5VpyqhFFF8TEN--M0oIN2g7A_Amht_F1KVhF1VhiU,16670
29
29
  skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
30
30
  skilleter_thingy/phototidier.py,sha256=5gSjlINUxf3ZQl3NG0o7CsWwODvTbokIMIafLFvn8Hc,7818
31
31
  skilleter_thingy/py_audit.py,sha256=xJm5k5qyeA6ii8mODa4dOkmP8L1drv94UHuxR54RsIM,4384
@@ -61,9 +61,9 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
61
61
  skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
62
62
  skilleter_thingy/thingy/tidy.py,sha256=71DCyj0VJrj52RmjQyj1eOiQJIfy5EIPHuThOrS6ZTA,5876
63
63
  skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
64
- skilleter_thingy-0.0.89.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
65
- skilleter_thingy-0.0.89.dist-info/METADATA,sha256=m_ybn_cE_YK_cnxhqEmXKxyPm32Kx5cYWuRPwcqURUA,8236
66
- skilleter_thingy-0.0.89.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
67
- skilleter_thingy-0.0.89.dist-info/entry_points.txt,sha256=u5ymS-KPljIGTnprV5yJsAjz7qgeT2BZ-Qo_Con_PFM,2145
68
- skilleter_thingy-0.0.89.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
69
- skilleter_thingy-0.0.89.dist-info/RECORD,,
64
+ skilleter_thingy-0.0.91.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
65
+ skilleter_thingy-0.0.91.dist-info/METADATA,sha256=qWWQElEBKig5lAZ7X4oVuHqQCIQEXOwGPTXwsZNRYNE,8236
66
+ skilleter_thingy-0.0.91.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
67
+ skilleter_thingy-0.0.91.dist-info/entry_points.txt,sha256=u5ymS-KPljIGTnprV5yJsAjz7qgeT2BZ-Qo_Con_PFM,2145
68
+ skilleter_thingy-0.0.91.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
69
+ skilleter_thingy-0.0.91.dist-info/RECORD,,