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
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()