skilleter-thingy 0.0.38__py3-none-any.whl → 0.0.39__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 (69) hide show
  1. {skilleter_thingy-0.0.38.dist-info → skilleter_thingy-0.0.39.dist-info}/METADATA +1 -1
  2. skilleter_thingy-0.0.39.dist-info/RECORD +6 -0
  3. skilleter_thingy-0.0.39.dist-info/entry_points.txt +43 -0
  4. skilleter_thingy-0.0.39.dist-info/top_level.txt +1 -0
  5. __init__.py +0 -6
  6. addpath.py +0 -107
  7. borger.py +0 -269
  8. console_colours.py +0 -63
  9. diskspacecheck.py +0 -67
  10. docker_purge.py +0 -113
  11. ffind.py +0 -536
  12. ggit.py +0 -90
  13. ggrep.py +0 -154
  14. git_br.py +0 -180
  15. git_ca.py +0 -142
  16. git_cleanup.py +0 -287
  17. git_co.py +0 -220
  18. git_common.py +0 -61
  19. git_hold.py +0 -154
  20. git_mr.py +0 -92
  21. git_parent.py +0 -77
  22. git_review.py +0 -1428
  23. git_update.py +0 -385
  24. git_wt.py +0 -96
  25. gitcmp_helper.py +0 -322
  26. gitprompt.py +0 -274
  27. gl.py +0 -174
  28. gphotosync.py +0 -610
  29. linecount.py +0 -155
  30. moviemover.py +0 -133
  31. photodupe.py +0 -136
  32. phototidier.py +0 -248
  33. py_audit.py +0 -131
  34. readable.py +0 -270
  35. remdir.py +0 -126
  36. rmdupe.py +0 -550
  37. rpylint.py +0 -91
  38. skilleter_thingy-0.0.38.dist-info/RECORD +0 -66
  39. skilleter_thingy-0.0.38.dist-info/entry_points.txt +0 -43
  40. skilleter_thingy-0.0.38.dist-info/top_level.txt +0 -43
  41. splitpics.py +0 -99
  42. strreplace.py +0 -82
  43. sysmon.py +0 -435
  44. tfm.py +0 -920
  45. tfparse.py +0 -101
  46. thingy/__init__.py +0 -0
  47. thingy/colour.py +0 -213
  48. thingy/dc_curses.py +0 -278
  49. thingy/dc_defaults.py +0 -221
  50. thingy/dc_util.py +0 -50
  51. thingy/dircolors.py +0 -308
  52. thingy/docker.py +0 -95
  53. thingy/files.py +0 -142
  54. thingy/git.py +0 -1371
  55. thingy/git2.py +0 -1307
  56. thingy/gitlab.py +0 -193
  57. thingy/logger.py +0 -112
  58. thingy/path.py +0 -156
  59. thingy/popup.py +0 -87
  60. thingy/process.py +0 -112
  61. thingy/run.py +0 -334
  62. thingy/tfm_pane.py +0 -595
  63. thingy/tidy.py +0 -160
  64. trimpath.py +0 -84
  65. window_rename.py +0 -92
  66. xchmod.py +0 -125
  67. yamlcheck.py +0 -89
  68. {skilleter_thingy-0.0.38.dist-info → skilleter_thingy-0.0.39.dist-info}/LICENSE +0 -0
  69. {skilleter_thingy-0.0.38.dist-info → skilleter_thingy-0.0.39.dist-info}/WHEEL +0 -0
git_hold.py DELETED
@@ -1,154 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Archive one or more branches by tagging the branch then deleting it
3
- The branch tag is 'archive/BRANCH_NAME'"""
4
-
5
- import sys
6
- import argparse
7
- import fnmatch
8
-
9
- import thingy.colour as colour
10
- import thingy.git as git
11
-
12
- ################################################################################
13
- # Prefix for tags representing archived branches
14
-
15
- ARCHIVE_PREFIX = 'archive/'
16
-
17
- ################################################################################
18
-
19
- def archive_tag_name(branch):
20
- """Return the tag name for an archive branch"""
21
-
22
- return f'{ARCHIVE_PREFIX}{branch}'
23
-
24
- ################################################################################
25
-
26
- def archive_branch_name(tag):
27
- """Return the branch name for an archive tag"""
28
-
29
- if not tag.startswith(ARCHIVE_PREFIX):
30
- raise git.GitError(f'{tag} is not an archive tag')
31
-
32
- return tag[len(ARCHIVE_PREFIX):]
33
-
34
- ################################################################################
35
-
36
- def archive_tags():
37
- """Return the list of current archive tags"""
38
-
39
- return [tag for tag in git.tags() if tag.startswith(ARCHIVE_PREFIX)]
40
-
41
- ################################################################################
42
-
43
- def archive_branches(branches):
44
- """Archive one or more branches"""
45
-
46
- tags = archive_tags()
47
- current_branch = git.branch()
48
-
49
- for branch in branches:
50
- if not git.isbranch(branch):
51
- colour.error(f'[RED:ERROR:] Branch {branch} does not exist')
52
-
53
- if archive_tag_name(branch) in tags:
54
- colour.error(f'[RED:ERROR:] An archive tag already exists for branch {branch}')
55
-
56
- if branch == current_branch:
57
- colour.error(f'[RED:ERROR:] Cannot archive the current branch')
58
-
59
- for branch in branches:
60
- tag_name = archive_tag_name(branch)
61
-
62
- git.set_tag(tag_name, branch)
63
- git.delete_branch(branch, force=True)
64
-
65
- for remote in git.remotes():
66
- git.push(repository=remote, tags=True)
67
-
68
- ################################################################################
69
-
70
- def list_archive_branches(branches):
71
- """List archive branches, optionally only those matching entries in the
72
- branches parameter"""
73
-
74
- tags = archive_tags()
75
-
76
- if branches:
77
- report = set()
78
-
79
- for branch in branches:
80
- for tag in tags:
81
- branch_name = archive_branch_name(tag)
82
- if branch_name not in report and fnmatch.fnmatch(branch_name, branch):
83
- report.add(branch_name)
84
- else:
85
- report = set(tags)
86
-
87
- for branch_name in sorted(report):
88
- print(branch_name)
89
-
90
- ################################################################################
91
-
92
- def restore_archive_branches(branches):
93
- """Restore archived branches"""
94
-
95
- tags = archive_tags()
96
-
97
- for branch in branches:
98
- if not archive_tag_name(branch) in tags:
99
- colour.error(f'[RED:ERROR:] Archive branch {branch} does not exist')
100
-
101
- archive_tag_names = []
102
-
103
- for branch in branches:
104
- archive_tag = archive_tag_name(branch)
105
- archive_tag_names.append(archive_tag)
106
-
107
- git.checkout(branch, commit=archive_tag)
108
- git.delete_tag(archive_tag)
109
-
110
- for remote in git.remotes():
111
- git.push(repository=remote, delete=True, refspec=archive_tag_names)
112
-
113
- ################################################################################
114
-
115
- def main():
116
- """Main function"""
117
-
118
- parser = argparse.ArgumentParser(description='Archive, list or recover one or more Git branches')
119
- parser.add_argument('--list', '-l', action='store_true', help='List archived branches')
120
- parser.add_argument('--restore', '-r', action='store_true', help='Restore archived branches')
121
- parser.add_argument('branches', nargs='*', help='Branches')
122
-
123
- args = parser.parse_args()
124
-
125
- if args.list and args.restore:
126
- colour.error('[RED:ERROR:] The list and restore options cannot be specified together')
127
-
128
- if not args.branches and not args.list:
129
- colour.error('[RED:ERROR:] No branches specified')
130
-
131
- if args.list:
132
- list_archive_branches(args.branches)
133
- elif args.restore:
134
- restore_archive_branches(args.branches)
135
- else:
136
- archive_branches(args.branches)
137
-
138
- ################################################################################
139
-
140
- def git_hold():
141
- """Entry point"""
142
-
143
- try:
144
- main()
145
-
146
- except KeyboardInterrupt:
147
- sys.exit(1)
148
- except BrokenPipeError:
149
- sys.exit(2)
150
-
151
- ################################################################################
152
-
153
- if __name__ == '__main__':
154
- git_hold()
git_mr.py DELETED
@@ -1,92 +0,0 @@
1
- #! /usr/bin/env python3
2
-
3
- ################################################################################
4
- """ Push to Gitlab and create a merge request at the same time """
5
- ################################################################################
6
-
7
- import logging
8
- import sys
9
- import argparse
10
-
11
- import thingy.git as git
12
- import thingy.colour as colour
13
-
14
- ################################################################################
15
-
16
- DESCRIPTION = 'Push a feature branch to GitLab and create a merge request'
17
-
18
- ################################################################################
19
-
20
- def parse_arguments():
21
- """ Parse and return command line arguments """
22
-
23
- parser = argparse.ArgumentParser(description=DESCRIPTION, formatter_class=argparse.RawTextHelpFormatter)
24
-
25
- parser.add_argument('--debug', action='store_true', help='Enable debug output')
26
- parser.add_argument('-f', '--force', action='store_true', help='Force-push the branch')
27
- parser.add_argument('--parent', '-p', action='store', help='Override the default parent and specify the branch to merge onto')
28
- parser.add_argument('--reviewer', '-r', action='store', help='Specify the name of the reviewer for the merge request')
29
- parser.add_argument('--keep', '-k', action='store_true', help='Keep the source branch after the merge (default is to delete it).')
30
-
31
- args = parser.parse_args()
32
-
33
- # Enable logging if requested
34
-
35
- if args.debug:
36
- logging.basicConfig(level=logging.INFO)
37
-
38
- return args
39
-
40
- ################################################################################
41
-
42
- def main():
43
- """ Main function - parse the command line and perform the pushing """
44
-
45
- args = parse_arguments()
46
-
47
- if args.parent:
48
- parents = [args.parent]
49
- else:
50
- parents, _ = git.parents()
51
-
52
- if len(parents) > 1:
53
- parent_list = ', '.join(parents)
54
- colour.error(
55
- f'Branch has multiple potential parents: [BLUE]{parent_list}[NORMAL]. Use the [BLUE]--parent[NORMAL] option to specify the appropriate one.')
56
- elif not parents:
57
- colour.error('Unable to determine parent branch. Use the [BLUE]--parent[NORMAL] option to specify the appropriate one.')
58
-
59
- options = ['merge_request.create', f'merge_request.target={parents[0]}']
60
-
61
- if args.reviewer:
62
- options.append(f'merge_request.assign={args.reviewer}')
63
-
64
- if not args.keep:
65
- options.append('merge_request.remove_source_branch')
66
-
67
- logging.debug('Running git push with:')
68
- logging.debug(' force: %s', args.force)
69
- logging.debug(' push options: %s', options)
70
-
71
- result = git.push(force_with_lease=args.force, push_options=options)
72
-
73
- for text in result:
74
- print(text)
75
-
76
- ################################################################################
77
-
78
- def git_mr():
79
- """Entry point"""
80
-
81
- try:
82
- main()
83
-
84
- except KeyboardInterrupt:
85
- sys.exit(1)
86
- except BrokenPipeError:
87
- sys.exit(2)
88
-
89
- ################################################################################
90
-
91
- if __name__ == '__main__':
92
- git_mr()
git_parent.py DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- """
4
- Attempt to determine the parent branch of a commit by tracking down
5
- the branch commit history and looking for other branches that share
6
- the same commit. Can optionally ignore feature branches and/or report
7
- the distance to the potential parent.
8
- """
9
-
10
- import argparse
11
- import sys
12
-
13
- import thingy.git as git
14
- import thingy.colour as colour
15
-
16
- ################################################################################
17
-
18
- def main():
19
- """ Main function """
20
-
21
- parser = argparse.ArgumentParser(description='Attempt to determine the parent branch for the specified branch (defaulting to the current one)')
22
- parser.add_argument('-a', '--all', action='store_true', help='Include feature branches as possible parents')
23
- parser.add_argument('-v', '--verbose', action='store_true', help='Report verbose results (includes number of commits between branch and parent)')
24
- parser.add_argument('branch', action='store', nargs='?', type=str, default='HEAD', help='Branch, commit or commit')
25
-
26
- args = parser.parse_args()
27
-
28
- try:
29
- if args.all:
30
- any_parents, any_distance = git.parents(args.branch)
31
- else:
32
- any_parents = []
33
-
34
- parents, distance = git.parents(args.branch, ignore='feature/*')
35
-
36
- # If we have feature and non-feature branch candidates, decide which to report
37
- # (one or both) based on distance.
38
-
39
- if parents and any_parents:
40
- if any_distance < distance:
41
- parents = any_parents
42
- distance = any_distance
43
- elif any_distance == distance:
44
- for more in any_parents:
45
- if more not in parents:
46
- parents.append(more)
47
-
48
- except git.GitError as exc:
49
- colour.error(f'[RED:ERROR:] {exc.msg}', status=exc.status)
50
-
51
- if parents:
52
- if args.verbose:
53
- if len(parents) == 1:
54
- colour.write(f'Parent branch [BLUE:{parents[0]}] is [BLUE:{distance}] commits away from [BLUE:{args.branch}]')
55
- else:
56
- colour.write(f'Parent branches [BLUE:%s] are [BLUE:{distance}] commits away from [BLUE:{args.branch}[' % (', '.join(parents)))
57
- else:
58
- print(', '.join(parents))
59
- else:
60
- colour.error('[RED:Could not determine parent branch]\n')
61
-
62
- ################################################################################
63
-
64
- def git_parent():
65
- """Entry point"""
66
-
67
- try:
68
- main()
69
- except KeyboardInterrupt:
70
- sys.exit(1)
71
- except BrokenPipeError:
72
- sys.exit(2)
73
-
74
- ################################################################################
75
-
76
- if __name__ == '__main__':
77
- git_parent()