skilleter-thingy 0.0.37__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 (68) hide show
  1. {skilleter_thingy-0.0.37.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/top_level.txt +1 -0
  4. skilleter_thingy/__init__.py +0 -6
  5. skilleter_thingy/addpath.py +0 -107
  6. skilleter_thingy/borger.py +0 -269
  7. skilleter_thingy/console_colours.py +0 -63
  8. skilleter_thingy/diskspacecheck.py +0 -67
  9. skilleter_thingy/docker_purge.py +0 -113
  10. skilleter_thingy/ffind.py +0 -536
  11. skilleter_thingy/ggit.py +0 -90
  12. skilleter_thingy/ggrep.py +0 -154
  13. skilleter_thingy/git_br.py +0 -180
  14. skilleter_thingy/git_ca.py +0 -142
  15. skilleter_thingy/git_cleanup.py +0 -287
  16. skilleter_thingy/git_co.py +0 -220
  17. skilleter_thingy/git_common.py +0 -61
  18. skilleter_thingy/git_hold.py +0 -154
  19. skilleter_thingy/git_mr.py +0 -92
  20. skilleter_thingy/git_parent.py +0 -77
  21. skilleter_thingy/git_review.py +0 -1428
  22. skilleter_thingy/git_update.py +0 -385
  23. skilleter_thingy/git_wt.py +0 -96
  24. skilleter_thingy/gitcmp_helper.py +0 -322
  25. skilleter_thingy/gitprompt.py +0 -274
  26. skilleter_thingy/gl.py +0 -174
  27. skilleter_thingy/gphotosync.py +0 -610
  28. skilleter_thingy/linecount.py +0 -155
  29. skilleter_thingy/moviemover.py +0 -133
  30. skilleter_thingy/photodupe.py +0 -136
  31. skilleter_thingy/phototidier.py +0 -248
  32. skilleter_thingy/py_audit.py +0 -131
  33. skilleter_thingy/readable.py +0 -270
  34. skilleter_thingy/remdir.py +0 -126
  35. skilleter_thingy/rmdupe.py +0 -550
  36. skilleter_thingy/rpylint.py +0 -91
  37. skilleter_thingy/splitpics.py +0 -99
  38. skilleter_thingy/strreplace.py +0 -82
  39. skilleter_thingy/sysmon.py +0 -435
  40. skilleter_thingy/tfm.py +0 -920
  41. skilleter_thingy/tfparse.py +0 -101
  42. skilleter_thingy/thingy/__init__.py +0 -0
  43. skilleter_thingy/thingy/colour.py +0 -213
  44. skilleter_thingy/thingy/dc_curses.py +0 -278
  45. skilleter_thingy/thingy/dc_defaults.py +0 -221
  46. skilleter_thingy/thingy/dc_util.py +0 -50
  47. skilleter_thingy/thingy/dircolors.py +0 -308
  48. skilleter_thingy/thingy/docker.py +0 -95
  49. skilleter_thingy/thingy/files.py +0 -142
  50. skilleter_thingy/thingy/git.py +0 -1371
  51. skilleter_thingy/thingy/git2.py +0 -1307
  52. skilleter_thingy/thingy/gitlab.py +0 -193
  53. skilleter_thingy/thingy/logger.py +0 -112
  54. skilleter_thingy/thingy/path.py +0 -156
  55. skilleter_thingy/thingy/popup.py +0 -87
  56. skilleter_thingy/thingy/process.py +0 -112
  57. skilleter_thingy/thingy/run.py +0 -334
  58. skilleter_thingy/thingy/tfm_pane.py +0 -595
  59. skilleter_thingy/thingy/tidy.py +0 -160
  60. skilleter_thingy/trimpath.py +0 -84
  61. skilleter_thingy/window_rename.py +0 -92
  62. skilleter_thingy/xchmod.py +0 -125
  63. skilleter_thingy/yamlcheck.py +0 -89
  64. skilleter_thingy-0.0.37.dist-info/RECORD +0 -66
  65. skilleter_thingy-0.0.37.dist-info/top_level.txt +0 -1
  66. {skilleter_thingy-0.0.37.dist-info → skilleter_thingy-0.0.39.dist-info}/LICENSE +0 -0
  67. {skilleter_thingy-0.0.37.dist-info → skilleter_thingy-0.0.39.dist-info}/WHEEL +0 -0
  68. {skilleter_thingy-0.0.37.dist-info → skilleter_thingy-0.0.39.dist-info}/entry_points.txt +0 -0
skilleter_thingy/gl.py DELETED
@@ -1,174 +0,0 @@
1
- #! /usr/bin/env python3
2
-
3
- """ Nearly MVP of a command to do things to GitLab
4
- Currently just implements the 'mr-list' command which outputs a list
5
- of merge requests from all projects in CSV format.
6
-
7
- TODO: Lots and lots of things! """
8
-
9
- ################################################################################
10
-
11
- import argparse
12
- import os
13
- import sys
14
- from collections import defaultdict
15
-
16
- import thingy.colour as colour
17
- import thingy.gitlab as gitlab
18
-
19
- ################################################################################
20
-
21
- def mr_list(args):
22
- """ List merge requests """
23
-
24
- gl = gitlab.GitLab(args.server)
25
-
26
- # TODO: Could incorporate some/all filtering in the request rather than getting all MRs and filtering them
27
-
28
- mrs = gl.merge_requests(scope='all')
29
-
30
- # TODO: Output format other than CSV
31
- # TODO: More filtering
32
-
33
- if args.summary:
34
- authors = defaultdict(int)
35
- reviewers = defaultdict(int)
36
- combos = defaultdict(int)
37
-
38
- count = 0
39
- for mr in mrs:
40
- author = mr['author']['username']
41
- authors[author] += 1
42
-
43
- if mr['state'] == 'merged':
44
- try:
45
- reviewer = mr['merged_by']['username']
46
- except TypeError:
47
- reviewer = 'UNKNOWN'
48
-
49
- reviewers[reviewer] += 1
50
- combos[f"{author}|{reviewer}"] += 1
51
-
52
- count += 1
53
- if args.limit and count > args.limit:
54
- break
55
-
56
- print('Number of merge requests by author')
57
-
58
- for value in sorted(set(authors.values()), reverse=True):
59
- for person in authors:
60
- if authors[person] == value:
61
- print(f' {person:32}: {authors[person]}')
62
-
63
- print()
64
- print('Number of merge requests by reviewer')
65
-
66
- for value in sorted(set(reviewers.values()), reverse=True):
67
- for person in reviewers:
68
- if reviewers[person] == value:
69
- print(f' {person:32}: {reviewers[person]}')
70
-
71
- print()
72
- print('Author/Reviewer combinations for merged changes')
73
-
74
- for value in sorted(set(combos.values()), reverse=True):
75
- for combo in combos:
76
- if combos[combo] == value:
77
- author, reviewer = combo.split('|')
78
-
79
- print(f' Written by {author}, reviewed by {reviewer}: {combos[combo]}')
80
-
81
- else:
82
- print('state,merge id,project id,author,approver,title,merge date')
83
-
84
- for mr in mrs:
85
- if args.author and mr['author']['username'] != args.author:
86
- continue
87
-
88
- if mr['state'] == 'merged':
89
- try:
90
- merged_by = mr['merged_by']['username']
91
- except TypeError:
92
- merged_by = 'NONE'
93
-
94
- if args.approver and merged_by != args.approver:
95
- continue
96
-
97
- if not args.summary:
98
- print('%s,%s,%s,%s,%s,%s,"%s"' % (mr['state'], mr['id'], mr['project_id'],
99
- mr['author']['username'], merged_by, mr['title'], mr['merged_at']))
100
- elif args.all and not args.summary:
101
- print('%s,%s,%s,%s,,"%s",' % (mr['state'], mr['id'], mr['project_id'], mr['author']['username'], mr['title']))
102
-
103
- count += 1
104
- if args.limit and count > args.limit:
105
- break
106
-
107
- ################################################################################
108
-
109
- def main():
110
- """ Entry point """
111
-
112
- parser = argparse.ArgumentParser(description='Gitlab commands')
113
-
114
- parser.add_argument('--dryrun', '--dry-run', '-D', action='store_true', help='Dry-run comands')
115
- parser.add_argument('--debug', '-d', action='store_true', help='Debug')
116
- parser.add_argument('--verbose', '-v', action='store_true', help='Verbosity to the maximum')
117
- parser.add_argument('--server', '-s', default=None, help='The GitLab server')
118
- parser.add_argument('--token', '-t', default=None, help='The GitLab access token')
119
-
120
- subparsers = parser.add_subparsers(dest='command')
121
-
122
- parser_mr_list = subparsers.add_parser('mr-list', help='List merge requests')
123
- parser_mr_list.add_argument('--all', action='store_true', help='List un-merged merge requests')
124
- parser_mr_list.add_argument('--author', action='store', help='List merge requests created by a specific user')
125
- parser_mr_list.add_argument('--approver', action='store', help='List merge requests approved by a specific user')
126
- parser_mr_list.add_argument('--summary', action='store_true', help='Produce a summary report')
127
- parser_mr_list.add_argument('--limit', action='store', type=int, help='Output the first N merge requests')
128
-
129
- # TODO: Other subcommands
130
-
131
- # Parse the command line
132
-
133
- args = parser.parse_args()
134
-
135
- # Check the server/token configuration
136
-
137
- if not args.server:
138
- args.server = os.environ.get('GITLAB_SERVER', None)
139
-
140
- if not args.server:
141
- colour.error('The GitLab server must be specified on the command line or via the [BLUE:GITLAB_SERVER] environment variable')
142
-
143
- if not args.token:
144
- args.token = os.environ.get('GITLAB_TOKEN', None)
145
-
146
- if not args.token:
147
- colour.error('GitLab access token must be specified on the command line or via the [BLUE:GITLAB_TOKEN] environment variable')
148
-
149
- # Invoke the subcommand
150
-
151
- if args.command == 'mr-list':
152
- mr_list(args)
153
-
154
- elif not args.command:
155
- colour.error('No command specified')
156
- else:
157
- colour.error(f'Invalid command: "{args.command}"')
158
-
159
- ################################################################################
160
-
161
- def gl():
162
- """Entry point"""
163
-
164
- try:
165
- main()
166
- except KeyboardInterrupt:
167
- sys.exit(1)
168
- except BrokenPipeError:
169
- sys.exit(2)
170
-
171
- ################################################################################
172
-
173
- if __name__ == '__main__':
174
- gl()