skilleter-thingy 0.1.25__tar.gz → 0.1.26__tar.gz

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 (74) hide show
  1. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/PKG-INFO +3 -1
  2. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/README.md +2 -0
  3. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/pyproject.toml +1 -1
  4. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/multigit.py +45 -8
  5. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/PKG-INFO +3 -1
  6. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/LICENSE +0 -0
  7. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/setup.cfg +0 -0
  8. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/__init__.py +0 -0
  9. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/addpath.py +0 -0
  10. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/borger.py +0 -0
  11. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/console_colours.py +0 -0
  12. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/diskspacecheck.py +0 -0
  13. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/docker_purge.py +0 -0
  14. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/ffind.py +0 -0
  15. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/ggit.py +0 -0
  16. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/ggrep.py +0 -0
  17. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_br.py +0 -0
  18. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_ca.py +0 -0
  19. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_cleanup.py +0 -0
  20. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_co.py +0 -0
  21. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_common.py +0 -0
  22. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_hold.py +0 -0
  23. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_mr.py +0 -0
  24. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_parent.py +0 -0
  25. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_retag.py +0 -0
  26. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_review.py +0 -0
  27. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_update.py +0 -0
  28. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/git_wt.py +0 -0
  29. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/gitcmp_helper.py +0 -0
  30. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/gitprompt.py +0 -0
  31. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/gl.py +0 -0
  32. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/linecount.py +0 -0
  33. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/localphotosync.py +0 -0
  34. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/moviemover.py +0 -0
  35. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/photodupe.py +0 -0
  36. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/phototidier.py +0 -0
  37. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/py_audit.py +0 -0
  38. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/readable.py +0 -0
  39. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/remdir.py +0 -0
  40. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/rmdupe.py +0 -0
  41. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/rpylint.py +0 -0
  42. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/splitpics.py +0 -0
  43. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/strreplace.py +0 -0
  44. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/sysmon.py +0 -0
  45. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/tfm.py +0 -0
  46. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/tfparse.py +0 -0
  47. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/__init__.py +0 -0
  48. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/colour.py +0 -0
  49. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/dc_curses.py +0 -0
  50. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/dc_defaults.py +0 -0
  51. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/dc_util.py +0 -0
  52. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/dircolors.py +0 -0
  53. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/docker.py +0 -0
  54. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/files.py +0 -0
  55. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/git.py +0 -0
  56. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/git2.py +0 -0
  57. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/gitlab.py +0 -0
  58. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/path.py +0 -0
  59. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/popup.py +0 -0
  60. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/process.py +0 -0
  61. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/run.py +0 -0
  62. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/tfm_pane.py +0 -0
  63. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/tidy.py +0 -0
  64. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/thingy/venv_template.py +0 -0
  65. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/trimpath.py +0 -0
  66. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/venv_create.py +0 -0
  67. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/window_rename.py +0 -0
  68. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/xchmod.py +0 -0
  69. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy/yamlcheck.py +0 -0
  70. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/SOURCES.txt +0 -0
  71. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
  72. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/entry_points.txt +0 -0
  73. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/requires.txt +0 -0
  74. {skilleter_thingy-0.1.25 → skilleter_thingy-0.1.26}/skilleter_thingy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilleter_thingy
3
- Version: 0.1.25
3
+ Version: 0.1.26
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
@@ -118,6 +118,8 @@ Multigit supports a small list of subcommands, each of which are prefixed with a
118
118
 
119
119
  `+untag TAG` - Remove the tag from the specified working trees (do nothing if the tag is not applied in the first place).
120
120
 
121
+ `+run COMMAND` - Run the specified command in each of the specified working trees
122
+
121
123
  Any command *not* prefixed with `+` is run in each of the working trees (filtered by the various multigit options) as a git command.
122
124
 
123
125
  For example; `multigit -m commit -ab` would run `git commit -a` in each of the working trees that is branched and contains modified files.
@@ -95,6 +95,8 @@ Multigit supports a small list of subcommands, each of which are prefixed with a
95
95
 
96
96
  `+untag TAG` - Remove the tag from the specified working trees (do nothing if the tag is not applied in the first place).
97
97
 
98
+ `+run COMMAND` - Run the specified command in each of the specified working trees
99
+
98
100
  Any command *not* prefixed with `+` is run in each of the working trees (filtered by the various multigit options) as a git command.
99
101
 
100
102
  For example; `multigit -m commit -ab` would run `git commit -a` in each of the working trees that is branched and contains modified files.
@@ -7,7 +7,7 @@ name = "skilleter_thingy"
7
7
 
8
8
  # Version must be incremented to install updated Thingy
9
9
 
10
- version = "0.1.25"
10
+ version = "0.1.26"
11
11
 
12
12
  authors = [
13
13
  {name="John Skilleter", email="john@skilleter.org.uk"},
@@ -6,6 +6,7 @@ import os
6
6
  import sys
7
7
  import fnmatch
8
8
  import configparser
9
+ import subprocess
9
10
 
10
11
  from dataclasses import dataclass, field
11
12
 
@@ -66,7 +67,7 @@ DEFAULT_BRANCH = 'DEFAULT'
66
67
  # commands are parameters so we have to manually create the help and parse the command line
67
68
 
68
69
  HELP_INFO = """usage: multigit [--help|-h] [--verbose|-v] [--quiet|-q] [--config|-c CONFIG] [--repos|-r REPOS] [--modified|-m] [--branched|-b] [--sub|-s] [--tag|-t TAGS] [--continue|-o] [--path|-C PATH]
69
- {+clone, +init, +config, +dir, +list, GIT_COMMAND} ...
70
+ {+clone, +init, +config, +dir, +list, +run, GIT_COMMAND} ...
70
71
 
71
72
  Run git commands in multiple Git repos. DISCLAIMER: This is beta-quality software, with missing features and liable to fail with a stack trace, but shouldn't eat your data
72
73
 
@@ -86,7 +87,7 @@ options:
86
87
  --path, -C PATH Run as if the command was started in PATH instead of the current working directory
87
88
 
88
89
  Sub-commands:
89
- {+clone, +init, +dir, +config, +list, GIT_COMMAND}
90
+ {+clone, +init, +dir, +config, +list, +run, GIT_COMMAND}
90
91
  +clone REPO {BRANCH} Clone a repo containing a multigit configuration file, then clone all the child repos and check out the default branch in each
91
92
  +init Build or update the configuration file using the current branch in each repo as the default branch
92
93
  +config Return the name and location of the configuration file
@@ -94,6 +95,7 @@ Sub-commands:
94
95
  +list Return a list of the top level directories of each of the Git repos
95
96
  +tag TAG Apply a configuration tag to repos filtered by the command line options (list configuration tags if no parameter specified)
96
97
  +untag TAG Remove a configuration tag to repos filtered by the command line options
98
+ +run COMMAND Run the specified command in repos filtered by the command line options
97
99
  GIT_COMMAND Any git command, including options and parameters - this is then run in all specified working trees
98
100
 
99
101
  """
@@ -421,7 +423,8 @@ def mg_init(args, config, console):
421
423
  else:
422
424
  config[repo]['repo name'] = os.path.basename(repo)
423
425
 
424
- colour.write(f'Added [BLUE:{repo}] with default branch [BLUE:{default_branch}]')
426
+ if not args.quiet:
427
+ colour.write(f'Added [BLUE:{repo}] with default branch [BLUE:{default_branch}]')
425
428
 
426
429
  if not args.quiet:
427
430
  colour.write(cleareol=True)
@@ -571,12 +574,43 @@ def mg_list(args, config, console):
571
574
 
572
575
  ################################################################################
573
576
 
574
- def run_git_command(args, config, console):
577
+ def mg_run(args, config, console):
575
578
  """Run a command in each of the working trees, optionally continuing if
576
579
  there's an error"""
577
580
 
578
581
  _ = console
579
582
 
583
+ if not args.parameters:
584
+ colour.error('[BOLD:+run] command - missing parameter(s)')
585
+
586
+ # Run the command in each of the working trees
587
+
588
+ for repo in select_git_repos(args, config):
589
+ if not args.quiet:
590
+ colour.write(f'\n[BLUE:{os.path.relpath(repo.name)}]\n')
591
+
592
+ repo_path = absolute_repo_path(args, repo.name)
593
+
594
+ try:
595
+ status = subprocess.run(args.parameters, cwd=repo_path)
596
+ except FileNotFoundError:
597
+ err_msg = f'"[BLUE:{args.parameters[0]}]" - Command not found'
598
+ if args.error_continue:
599
+ colour.write(f'[RED:WARNING]: {err_msg}')
600
+ else:
601
+ colour.error(f'[RED:ERROR]: {err_msg}')
602
+ else:
603
+ if status.returncode and not args.error_continue:
604
+ sys.exit(status)
605
+
606
+ ################################################################################
607
+
608
+ def run_git_command(args, config, console):
609
+ """Run a Git command in each of the working trees, optionally continuing if
610
+ there's an error"""
611
+
612
+ _ = console
613
+
580
614
  for repo in select_git_repos(args, config):
581
615
  repo_command = [args.command]
582
616
 
@@ -585,9 +619,10 @@ def run_git_command(args, config, console):
585
619
  for cmd in args.parameters:
586
620
  repo_command.append(branch_name(cmd, repo['default branch']))
587
621
 
588
- colour.write(f'\n[BLUE:{os.path.relpath(repo.name)}]\n')
622
+ if not args.quiet:
623
+ colour.write(f'\n[BLUE:{os.path.relpath(repo.name)}]\n')
589
624
 
590
- # Run the command in the workng tree
625
+ # Run the command in the working tree
591
626
 
592
627
  repo_path = absolute_repo_path(args, repo.name)
593
628
 
@@ -680,11 +715,12 @@ def parse_command_line():
680
715
  colour.error('The "[BOLD:--path]" option takes a path parameter')
681
716
 
682
717
  try:
683
- os.chdir(arg_list.pop(0))
718
+ workingdir = arg_list.pop(0)
719
+ os.chdir(workingdir)
684
720
  except IndexError:
685
721
  colour.error('The "[BOLD:-C]" option takes a path parameter', prefix=True)
686
722
  except FileNotFoundError:
687
- colour.error('"[BOLD:--path]" - path not found', prefix=True)
723
+ colour.error(f'"[BOLD:--path]" - path "[BLUE:{workingdir}]" not found', prefix=True)
688
724
 
689
725
  elif option in ('help', 'h'):
690
726
  colour.write(HELP_INFO)
@@ -729,6 +765,7 @@ COMMANDS = {
729
765
  'tag': mg_tag,
730
766
  'untag': mg_untag,
731
767
  'list': mg_list,
768
+ 'run': mg_run,
732
769
  }
733
770
 
734
771
  def main():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilleter_thingy
3
- Version: 0.1.25
3
+ Version: 0.1.26
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
@@ -118,6 +118,8 @@ Multigit supports a small list of subcommands, each of which are prefixed with a
118
118
 
119
119
  `+untag TAG` - Remove the tag from the specified working trees (do nothing if the tag is not applied in the first place).
120
120
 
121
+ `+run COMMAND` - Run the specified command in each of the specified working trees
122
+
121
123
  Any command *not* prefixed with `+` is run in each of the working trees (filtered by the various multigit options) as a git command.
122
124
 
123
125
  For example; `multigit -m commit -ab` would run `git commit -a` in each of the working trees that is branched and contains modified files.