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

Files changed (33) hide show
  1. skilleter_thingy/ggit.py +0 -1
  2. skilleter_thingy/ggrep.py +0 -1
  3. skilleter_thingy/git_br.py +0 -1
  4. skilleter_thingy/git_ca.py +0 -1
  5. skilleter_thingy/git_cleanup.py +1 -2
  6. skilleter_thingy/git_common.py +0 -1
  7. skilleter_thingy/git_hold.py +0 -1
  8. skilleter_thingy/git_mr.py +0 -1
  9. skilleter_thingy/git_parent.py +0 -1
  10. skilleter_thingy/git_retag.py +1 -1
  11. skilleter_thingy/git_review.py +0 -1
  12. skilleter_thingy/git_update.py +0 -1
  13. skilleter_thingy/git_wt.py +1 -1
  14. skilleter_thingy/gitcmp_helper.py +1 -1
  15. skilleter_thingy/gitprompt.py +0 -1
  16. skilleter_thingy/multigit.py +26 -35
  17. skilleter_thingy/rpylint.py +1 -2
  18. skilleter_thingy/tfparse.py +1 -1
  19. skilleter_thingy/thingy/docker.py +7 -5
  20. skilleter_thingy/thingy/files.py +2 -2
  21. skilleter_thingy/thingy/git.py +259 -187
  22. skilleter_thingy/thingy/process.py +20 -99
  23. skilleter_thingy/thingy/run.py +43 -0
  24. skilleter_thingy/thingy/venv_template.py +1 -1
  25. skilleter_thingy/trimpath.py +1 -1
  26. {skilleter_thingy-0.2.6.dist-info → skilleter_thingy-0.2.8.dist-info}/METADATA +1 -1
  27. skilleter_thingy-0.2.8.dist-info/RECORD +59 -0
  28. skilleter_thingy/thingy/git2.py +0 -1405
  29. skilleter_thingy-0.2.6.dist-info/RECORD +0 -60
  30. {skilleter_thingy-0.2.6.dist-info → skilleter_thingy-0.2.8.dist-info}/WHEEL +0 -0
  31. {skilleter_thingy-0.2.6.dist-info → skilleter_thingy-0.2.8.dist-info}/entry_points.txt +0 -0
  32. {skilleter_thingy-0.2.6.dist-info → skilleter_thingy-0.2.8.dist-info}/licenses/LICENSE +0 -0
  33. {skilleter_thingy-0.2.6.dist-info → skilleter_thingy-0.2.8.dist-info}/top_level.txt +0 -0
skilleter_thingy/ggit.py CHANGED
@@ -7,7 +7,6 @@ import os
7
7
  import subprocess
8
8
  import argparse
9
9
 
10
- # TODO: Update to git2
11
10
  import thingy.git as git
12
11
  import thingy.colour as colour
13
12
 
skilleter_thingy/ggrep.py CHANGED
@@ -14,7 +14,6 @@ import sys
14
14
  import argparse
15
15
 
16
16
  import thingy.colour as colour
17
- # TODO: Update to git2
18
17
  import thingy.git as git
19
18
 
20
19
  ################################################################################
@@ -22,7 +22,6 @@ import datetime
22
22
  from dateutil.parser import parse
23
23
  from dateutil.relativedelta import relativedelta
24
24
 
25
- # TODO: Update to git2
26
25
  import thingy.git as git
27
26
  import thingy.colour as colour
28
27
 
@@ -18,7 +18,6 @@ import sys
18
18
  import logging
19
19
 
20
20
  import thingy.colour as colour
21
- # TODO: Update to git2
22
21
  import thingy.git as git
23
22
 
24
23
  ################################################################################
@@ -14,7 +14,6 @@ import sys
14
14
  import argparse
15
15
  import logging
16
16
 
17
- # TODO: Update to git2
18
17
  import thingy.git as git
19
18
  import thingy.colour as colour
20
19
 
@@ -152,7 +151,7 @@ def main():
152
151
 
153
152
  # Has the branch got commits that haven't been merged to the master branch?
154
153
 
155
- logging.info('Checking for umerged commits on %s (against %s)', branch, args.master)
154
+ logging.info('Checking for unmerged commits on %s (against %s)', branch, args.master)
156
155
 
157
156
  try:
158
157
  unmerged = git.git(['log', '--no-merges', '--oneline', branch, '^%s' % args.master, '--'])
@@ -11,7 +11,6 @@ import sys
11
11
  import argparse
12
12
 
13
13
  import thingy.colour as colour
14
- # TODO: Update to git2
15
14
  import thingy.git as git
16
15
 
17
16
  ################################################################################
@@ -8,7 +8,6 @@ import argparse
8
8
  import fnmatch
9
9
 
10
10
  import thingy.colour as colour
11
- # TODO: Update to git2
12
11
  import thingy.git as git
13
12
 
14
13
  ################################################################################
@@ -9,7 +9,6 @@ import logging
9
9
  import sys
10
10
  import argparse
11
11
 
12
- # TODO: Update to git2
13
12
  import thingy.git as git
14
13
  import thingy.colour as colour
15
14
 
@@ -11,7 +11,6 @@ import os
11
11
  import argparse
12
12
  import sys
13
13
 
14
- # TODO: Update to git2
15
14
  import thingy.git as git
16
15
  import thingy.colour as colour
17
16
 
@@ -13,7 +13,7 @@ import os
13
13
  import sys
14
14
  import argparse
15
15
 
16
- import thingy.git2 as git
16
+ import thingy.git as git
17
17
  import thingy.colour as colour
18
18
 
19
19
  ################################################################################
@@ -54,7 +54,6 @@ import subprocess
54
54
  import time
55
55
  from enum import IntEnum
56
56
 
57
- # TODO: Update to git2
58
57
  import thingy.git as git
59
58
  import thingy.dc_curses as dc_curses
60
59
  import thingy.colour as colour
@@ -27,7 +27,6 @@ import argparse
27
27
  import fnmatch
28
28
  import logging
29
29
 
30
- # TODO: Update to git2
31
30
  import thingy.git as git
32
31
  import thingy.colour as colour
33
32
 
@@ -14,7 +14,7 @@ import sys
14
14
  import argparse
15
15
  import os
16
16
 
17
- import thingy.git2 as git
17
+ import thingy.git as git
18
18
  import thingy.colour as colour
19
19
 
20
20
  ################################################################################
@@ -152,7 +152,7 @@ def main():
152
152
  # Make sure that we have all the expected parameters
153
153
 
154
154
  if args.new_perm is None:
155
- sys.stderr.write('Either 1 or 7 parameters must be specifed\n')
155
+ sys.stderr.write('Either 1 or 7 parameters must be specified\n')
156
156
  sys.exit(1)
157
157
 
158
158
  # Make sure we can access the temporary files supplied
@@ -49,7 +49,6 @@ import os
49
49
  import sys
50
50
  import argparse
51
51
 
52
- # TODO: Update to git2
53
52
  import thingy.git as git
54
53
  import thingy.colour as colour
55
54
 
@@ -10,7 +10,7 @@ import subprocess
10
10
 
11
11
  from dataclasses import dataclass, field
12
12
 
13
- import thingy.git2 as git
13
+ import thingy.git as git
14
14
  import thingy.colour as colour
15
15
 
16
16
  ################################################################################
@@ -367,14 +367,14 @@ def mg_clone(args, config, console):
367
367
  if os.path.isdir(directory):
368
368
  colour.error(f'The "[BLUE:{directory}]" directory already exists', prefix=True)
369
369
  else:
370
- colour.error(f'[BLUE:{directory}]" already exists', prefix=True)
370
+ colour.error(f'"[BLUE:{directory}]" already exists', prefix=True)
371
371
 
372
372
  # Clone the repo and chdir into it
373
373
 
374
374
  if not args.quiet:
375
375
  colour.write(f'Cloning [BOLD:{args.parameters[0]}] into [BLUE:{directory}]')
376
376
 
377
- git.clone(args.parameters[0], path=directory)
377
+ git.clone(args.parameters[0], working_tree=directory)
378
378
 
379
379
  os.chdir(directory)
380
380
 
@@ -406,7 +406,7 @@ def mg_clone(args, config, console):
406
406
  if not args.quiet:
407
407
  colour.write(f'Cloning [BLUE:{repo["origin"]}] into [BLUE:{directory}]')
408
408
 
409
- git.clone(repo['origin'], path=repo.name)
409
+ git.clone(repo['origin'], working_tree=repo.name)
410
410
 
411
411
  if not args.quiet:
412
412
  colour.write(f' Checking out [BLUE:{repo["default branch"]}]')
@@ -450,7 +450,7 @@ def mg_init(args, config, console):
450
450
 
451
451
  for entry in removals:
452
452
  del config[entry]
453
- colour.write(f'Removed [BLUE:{repo}] as it no longer exists')
453
+ colour.write(f'Removed [BLUE:{entry}] as it no longer exists')
454
454
 
455
455
  # The configuration file needs to be updated
456
456
 
@@ -488,10 +488,10 @@ def mg_add(args, config, console):
488
488
  else:
489
489
  colour.error(f'"[BLUE:{location}]" already exists and was not cloned from [BLUE:{repo}]', prefix=True)
490
490
  else:
491
- colour.error(f'"[BLUE:{location}]" already exists and is not a Git working tree')
491
+ colour.error(f'"[BLUE:{location}]" already exists and is not a Git working tree', prefix=True)
492
492
 
493
493
  else:
494
- git.clone(repo, path=location)
494
+ git.clone(repo, working_tree=location)
495
495
 
496
496
  # Add to the configuration
497
497
 
@@ -524,41 +524,32 @@ def mg_dir(args, config, console):
524
524
  # If a parameter is specified, look for matches, otherwise just return the location of the
525
525
  # configuration file
526
526
 
527
- if args.parameters:
528
- location = []
529
- wild_location = []
527
+ if not args.parameters:
528
+ colour.write(os.path.dirname(args.configuration_file))
529
+ return
530
+
531
+ locations = []
530
532
 
531
- search_name = args.parameters[0]
533
+ search_name = args.parameters[0]
532
534
 
533
- # Search for exact matches, or matches that contain the search term if it
534
- # doesn't already contain a wildcard
535
+ # Search for wildcard matches, or matches that contain the search term if it
536
+ # doesn't already contain a wildcard
535
537
 
538
+ if '*' in search_name or '?' in search_name:
539
+ search_name = f'*{search_name}*'
536
540
  for repo in select_git_repos(args, config):
537
541
  if fnmatch.fnmatch(repo['repo name'], search_name):
538
- location.append(repo.name)
539
-
540
- elif '*' not in search_name:
541
- if fnmatch.fnmatch(repo['repo name'], f'*{search_name}*'):
542
- wild_location.append(repo.name)
543
-
544
- # Look for a single exact match, a prefix with '*' match or prefix+suffix
545
-
546
- destination = None
547
- for destinations in (location, wild_location):
548
- if len(destinations) == 1:
549
- destination = destinations
550
- break
551
-
552
- if len(destinations) > 1:
553
- destination = destinations
542
+ locations.append(repo.name)
543
+ else:
544
+ for repo in select_git_repos(args, config):
545
+ if search_name in repo['repo name']:
546
+ locations.append(repo.name)
554
547
 
555
- if not destination:
556
- colour.error(f'No matches with [BLUE:{search_name}]', prefix=True)
548
+ if not locations:
549
+ colour.error(f'No matches with [BLUE:{search_name}]', prefix=True)
557
550
 
558
- colour.write("\n".join([relative_repo_path(args, d) for d in destination]))
551
+ colour.write("\n".join([relative_repo_path(args, loc) for loc in locations]))
559
552
 
560
- else:
561
- colour.write(os.path.dirname(args.configuration_file))
562
553
 
563
554
  ################################################################################
564
555
 
@@ -637,7 +628,7 @@ def mg_run(args, config, console):
637
628
  _ = console
638
629
 
639
630
  if not args.parameters:
640
- colour.error('[BOLD:+run] command - missing parameter(s)')
631
+ colour.error('[BOLD:+run] command - missing parameter(s)', prefix=True)
641
632
 
642
633
  # Run the command in each of the working trees
643
634
 
@@ -11,7 +11,6 @@ import sys
11
11
  import argparse
12
12
  import glob
13
13
 
14
- # TODO: Convert to use thingy.proc
15
14
  import thingy.process as process
16
15
 
17
16
  ################################################################################
@@ -20,7 +19,7 @@ def main():
20
19
  """ Main code. Exits directly on failure to locate source files, or returns
21
20
  the status code from Pylint otherwise. """
22
21
 
23
- # Parse the comand line
22
+ # Parse the command line
24
23
 
25
24
  parser = argparse.ArgumentParser(description='Run pylint in the current (or specified) directory/ies')
26
25
 
@@ -37,7 +37,7 @@ def main():
37
37
 
38
38
  # Open the input file or use stdin and read the JSON
39
39
 
40
- jsonfile = open(sys.argv[1], 'rt') if args.infile else sys.stdin
40
+ jsonfile = open(args.infile[0], 'rt') if args.infile else sys.stdin
41
41
 
42
42
  terraform = json.loads(jsonfile.read())
43
43
 
@@ -12,7 +12,6 @@
12
12
  """
13
13
  ################################################################################
14
14
 
15
- # TODO: Convert to use thingy.proc
16
15
  import thingy.process as process
17
16
 
18
17
  ################################################################################
@@ -32,12 +31,15 @@ def instances(all=False):
32
31
  if all:
33
32
  cmd.append('-a')
34
33
 
34
+ instances_list = []
35
35
  try:
36
36
  for result in process.run(cmd):
37
- yield result
37
+ instances_list.append(result)
38
38
  except process.RunError as exc:
39
39
  raise DockerError(exc)
40
40
 
41
+ return instances_list
42
+
41
43
  ################################################################################
42
44
 
43
45
  def stop(instance, force=False):
@@ -46,7 +48,7 @@ def stop(instance, force=False):
46
48
  # TODO: force option not implemented
47
49
 
48
50
  try:
49
- process.run(['docker', 'stop', instance])
51
+ process.run(['docker', 'stop', instance], foreground=True)
50
52
  except process.RunError as exc:
51
53
  raise DockerError(exc)
52
54
 
@@ -63,7 +65,7 @@ def rm(instance, force=False):
63
65
  cmd.append(instance)
64
66
 
65
67
  try:
66
- process.run(cmd)
68
+ process.run(cmd, foreground=True)
67
69
  except process.RunError as exc:
68
70
  raise DockerError(exc)
69
71
 
@@ -90,6 +92,6 @@ def rmi(image, force=False):
90
92
  cmd.append(image)
91
93
 
92
94
  try:
93
- process.run(cmd)
95
+ process.run(cmd, foreground=True)
94
96
  except process.RunError as exc:
95
97
  raise DockerError(exc)
@@ -12,7 +12,6 @@
12
12
  import os
13
13
  import shutil
14
14
 
15
- # TODO: Convert to use thingy.proc
16
15
  import thingy.process as process
17
16
 
18
17
  ################################################################################
@@ -41,7 +40,8 @@ def file_type(filename, mime=False):
41
40
 
42
41
  cmd.append(filename)
43
42
 
44
- return process.run(cmd)[0]
43
+ result = process.run(cmd)
44
+ return result[0] if result else ""
45
45
 
46
46
  ################################################################################
47
47