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

@@ -15,22 +15,23 @@ import thingy.colour as colour
15
15
  ################################################################################
16
16
 
17
17
  # DONE: / Output name of each git repo as it is processed as command sits there seeming to do nothing otherwise.
18
+ # DONE: Better error-handling - e.g. continue/abort option after failure in one repo
18
19
  # DONE: Don't save the configuration on exit if it hasn't changed
19
20
  # DONE: Don't use a fixed list of default branch names
21
+ # DONE: If the config file isn't in the current directory then search up the directory tree for it but run in the current directory
20
22
  # DONE: Use the configuration file
21
23
  # DONE: init function
22
- # TODO: -j option to run in parallel?
24
+ # NOPE: Dry-run option - just pass the option to the Git command
25
+ # NOPE: Is it going to be a problem if the same repo is checked out twice or more in the same workspace - user problem
23
26
  # NOPE: Pull/fetch - only output after running command and only if something updated
24
- # DONE: Better error-handling - e.g. continue/abort option after failure in one repo
27
+ # NOPE: Switch to tomlkit
28
+ # TODO: -j option to run in parallel - yes, but it will only work with non-interactive Git commands
29
+ # TODO: Command that takes partial repo name and either returns full path or pops up window to autocomplete until single match found
25
30
  # TODO: Consistent colours in output
26
- # TODO: Dry-run option
27
- # DONE: If the config file isn't in the current directory then search up the directory tree for it but run in the current directory
28
31
  # TODO: If run in a subdirectory, only process repos in that tree (or have an option to do so)
29
- # TODO: Is it going to be a problem if the same repo is checked out twice or more in the same workspace
30
- # NOPE: Switch to tomlkit
31
32
  # TODO: Verbose option
32
33
  # TODO: When specifying list of repos, if repo name doesn't contain '/' prefix it with '*'?
33
-
34
+ # TODO: select_git_repos() and +dir should use consist way of selecting repos if possible
34
35
  ################################################################################
35
36
 
36
37
  DEFAULT_CONFIG_FILE = 'multigit.toml'
@@ -248,9 +249,9 @@ def mg_init(args, config, console):
248
249
 
249
250
  if 'origin' in remote:
250
251
  config[repo]['origin'] = remote['origin']
251
- config[repo]['name']= os.path.basename(remote['origin']).removesuffix('.git')
252
+ config[repo]['repo name']= os.path.basename(remote['origin']).removesuffix('.git')
252
253
  else:
253
- config[repo]['name'] = os.path.basename(repo)
254
+ config[repo]['repo name'] = os.path.basename(repo)
254
255
 
255
256
  ################################################################################
256
257
 
@@ -268,18 +269,39 @@ def mg_dir(args, config, console):
268
269
  error('The +dir command takes no more than one parameter - the name of the working tree to search for')
269
270
  elif args.parameters:
270
271
  location = []
271
- search_dir = args.parameters[0]
272
+ wild_prefix_location = []
273
+ wild_location = []
274
+
275
+ search_name = args.parameters[0]
276
+
277
+ # Search for exact matches, matches if prefixed by '*' or prefixed and suffixed with '*'
278
+ # unless it already contains '*'
272
279
 
273
280
  for repo in select_git_repos(args, config):
274
- if fnmatch.fnmatch(repo['name'], search_dir):
281
+ if fnmatch.fnmatch(repo['repo name'], search_name):
275
282
  location.append(repo.name)
276
283
 
277
- if len(location) == 0:
278
- error(f'No matches with [BLUE:{search_dir}]')
279
- elif len(location) > 1:
280
- error(f'Multiple matches with [BLUE:{search_dir}] - {" ".join(location)}')
284
+ elif '*' not in search_name:
285
+ if fnmatch.fnmatch(repo['repo name'], f'*{search_name}'):
286
+ wild_prefix_location.append(repo.name)
287
+
288
+ elif fnmatch.fnmatch(repo['repo name'], f'*{search_name}*'):
289
+ wild_location.append(repo.name)
290
+
291
+ for destinations in (location, wild_prefix_location, wild_location):
292
+ if len(destinations) == 1:
293
+ destination = destinations
294
+ break
295
+ elif len(destinations) > 1:
296
+ destination = destinations
297
+
298
+ if not destination:
299
+ error(f'No matches with [BLUE:{search_name}]')
300
+
301
+ if len(destination) > 1:
302
+ error(f'Multiple matches with [BLUE:{search_name}] - {" ".join(destination)}')
281
303
 
282
- colour.write(os.path.join(os.path.dirname(args.configuration_file), location[0]))
304
+ colour.write(os.path.join(os.path.dirname(args.configuration_file), destination[0]))
283
305
  else:
284
306
  colour.write(os.path.dirname(args.configuration_file))
285
307
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: skilleter_thingy
3
- Version: 0.0.93
3
+ Version: 0.0.94
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=ehTN6VD76i4U5k6dXuYoiqSRHI67_BP-bziklNAJSKY,4309
27
27
  skilleter_thingy/moviemover.py,sha256=QzUAWQzQ1AWWREIhl-VMaLo2h8MMhOekBnao5jGWV1s,4470
28
- skilleter_thingy/multigit.py,sha256=dpQDh_vZGqYHJk9PW2--UWLyM3pzC5Z8ihIWIuf6dkE,16722
28
+ skilleter_thingy/multigit.py,sha256=HYXOkcmarZslNQMHPfeomNpcRv_mVpy0fTblwHx1tGo,17858
29
29
  skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
30
30
  skilleter_thingy/phototidier.py,sha256=BOu-cKHMivDlBqlRqv7sL3J6Ix1K2dxWWNcderldyZo,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.93.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
65
- skilleter_thingy-0.0.93.dist-info/METADATA,sha256=oOCYioCKVkhTlaUrNCAo7X4s5743ejRUQpvj0EOegIk,8894
66
- skilleter_thingy-0.0.93.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
67
- skilleter_thingy-0.0.93.dist-info/entry_points.txt,sha256=u5ymS-KPljIGTnprV5yJsAjz7qgeT2BZ-Qo_Con_PFM,2145
68
- skilleter_thingy-0.0.93.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
69
- skilleter_thingy-0.0.93.dist-info/RECORD,,
64
+ skilleter_thingy-0.0.94.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
65
+ skilleter_thingy-0.0.94.dist-info/METADATA,sha256=X0akBir0A11H1PmDBcm6hnfStNhZUcMXJxGMLaK8MVk,8894
66
+ skilleter_thingy-0.0.94.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
67
+ skilleter_thingy-0.0.94.dist-info/entry_points.txt,sha256=u5ymS-KPljIGTnprV5yJsAjz7qgeT2BZ-Qo_Con_PFM,2145
68
+ skilleter_thingy-0.0.94.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
69
+ skilleter_thingy-0.0.94.dist-info/RECORD,,