skilleter-thingy 0.1.17__py3-none-any.whl → 0.1.19__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.
- skilleter_thingy/ffind.py +2 -2
- skilleter_thingy/ggit.py +1 -1
- skilleter_thingy/git_br.py +2 -2
- skilleter_thingy/git_common.py +2 -2
- skilleter_thingy/git_hold.py +6 -6
- skilleter_thingy/git_parent.py +2 -2
- skilleter_thingy/git_review.py +14 -10
- skilleter_thingy/git_wt.py +5 -5
- skilleter_thingy/gitcmp_helper.py +6 -1
- skilleter_thingy/gphotosync.py +3 -3
- skilleter_thingy/localphotosync.py +2 -2
- skilleter_thingy/multigit.py +29 -33
- skilleter_thingy/thingy/colour.py +6 -2
- skilleter_thingy/thingy/git.py +2 -2
- skilleter_thingy/trimpath.py +5 -4
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/METADATA +1 -1
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/RECORD +21 -21
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/WHEEL +0 -0
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/entry_points.txt +0 -0
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/licenses/LICENSE +0 -0
- {skilleter_thingy-0.1.17.dist-info → skilleter_thingy-0.1.19.dist-info}/top_level.txt +0 -0
skilleter_thingy/ffind.py
CHANGED
|
@@ -380,10 +380,10 @@ def validate_arguments(args):
|
|
|
380
380
|
|
|
381
381
|
if args.git:
|
|
382
382
|
if git.working_tree() is None:
|
|
383
|
-
colour.error('
|
|
383
|
+
colour.error('The current directory is not inside a git working tree', prefix=True)
|
|
384
384
|
|
|
385
385
|
if args.dir:
|
|
386
|
-
colour.error('
|
|
386
|
+
colour.error('Git does not track directories, so you cannot search for them in a git working tree', prefix=True)
|
|
387
387
|
|
|
388
388
|
if args.verbose:
|
|
389
389
|
print(f'Searching directory "{args.path}" for matches with "{args.patterns}"')
|
skilleter_thingy/ggit.py
CHANGED
|
@@ -55,7 +55,7 @@ def main():
|
|
|
55
55
|
try:
|
|
56
56
|
os.chdir(args.path)
|
|
57
57
|
except FileNotFoundError:
|
|
58
|
-
colour.error(f'
|
|
58
|
+
colour.error(f'Invalid path [BLUE:{args.path}]', prefix=True)
|
|
59
59
|
|
|
60
60
|
# If the current directory is in a working tree and below the top-level
|
|
61
61
|
# directory then we run the git command here as well as in subdirectories
|
skilleter_thingy/git_br.py
CHANGED
|
@@ -39,7 +39,7 @@ def parse_command_line():
|
|
|
39
39
|
args = parser.parse_args()
|
|
40
40
|
|
|
41
41
|
if args.delete and not args.branches:
|
|
42
|
-
colour.error('
|
|
42
|
+
colour.error('You must specify the branches to delete', prefix=True)
|
|
43
43
|
|
|
44
44
|
return args
|
|
45
45
|
|
|
@@ -172,7 +172,7 @@ def git_br():
|
|
|
172
172
|
except BrokenPipeError:
|
|
173
173
|
sys.exit(2)
|
|
174
174
|
except git.GitError as exc:
|
|
175
|
-
colour.error(
|
|
175
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
176
176
|
|
|
177
177
|
################################################################################
|
|
178
178
|
|
skilleter_thingy/git_common.py
CHANGED
|
@@ -27,12 +27,12 @@ def main():
|
|
|
27
27
|
args = parser.parse_args()
|
|
28
28
|
|
|
29
29
|
if args.long and args.short:
|
|
30
|
-
colour.error('
|
|
30
|
+
colour.error('The [BLUE:--long] and [BLUE:--short] options cannot be used together', prefix=True)
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
33
|
ancestor = git.find_common_ancestor(args.commit1, args.commit2)
|
|
34
34
|
except git.GitError as exc:
|
|
35
|
-
colour.error(
|
|
35
|
+
colour.error(exc, status=exc.status, prefix=True)
|
|
36
36
|
|
|
37
37
|
if args.short:
|
|
38
38
|
print(ancestor)
|
skilleter_thingy/git_hold.py
CHANGED
|
@@ -48,13 +48,13 @@ def archive_branches(branches):
|
|
|
48
48
|
|
|
49
49
|
for branch in branches:
|
|
50
50
|
if not git.isbranch(branch):
|
|
51
|
-
colour.error(f'
|
|
51
|
+
colour.error(f'Branch {branch} does not exist', prefix=True)
|
|
52
52
|
|
|
53
53
|
if archive_tag_name(branch) in tags:
|
|
54
|
-
colour.error(f'
|
|
54
|
+
colour.error(f'An archive tag already exists for branch {branch}', prefix=True)
|
|
55
55
|
|
|
56
56
|
if branch == current_branch:
|
|
57
|
-
colour.error('
|
|
57
|
+
colour.error('Cannot archive the current branch', prefix=True)
|
|
58
58
|
|
|
59
59
|
for branch in branches:
|
|
60
60
|
tag_name = archive_tag_name(branch)
|
|
@@ -96,7 +96,7 @@ def restore_archive_branches(branches):
|
|
|
96
96
|
|
|
97
97
|
for branch in branches:
|
|
98
98
|
if archive_tag_name(branch) not in tags:
|
|
99
|
-
colour.error(f'
|
|
99
|
+
colour.error(f'Archive branch {branch} does not exist', prefix=True)
|
|
100
100
|
|
|
101
101
|
archive_tag_names = []
|
|
102
102
|
|
|
@@ -123,10 +123,10 @@ def main():
|
|
|
123
123
|
args = parser.parse_args()
|
|
124
124
|
|
|
125
125
|
if args.list and args.restore:
|
|
126
|
-
colour.error('
|
|
126
|
+
colour.error('The list and restore options cannot be specified together', prefix=True)
|
|
127
127
|
|
|
128
128
|
if not args.branches and not args.list:
|
|
129
|
-
colour.error('
|
|
129
|
+
colour.error('No branches specified', prefix=True)
|
|
130
130
|
|
|
131
131
|
if args.list:
|
|
132
132
|
list_archive_branches(args.branches)
|
skilleter_thingy/git_parent.py
CHANGED
|
@@ -48,7 +48,7 @@ def main():
|
|
|
48
48
|
parents.append(more)
|
|
49
49
|
|
|
50
50
|
except git.GitError as exc:
|
|
51
|
-
colour.error(
|
|
51
|
+
colour.error(exc.msg, status=exc.status, prefix=True)
|
|
52
52
|
|
|
53
53
|
if parents:
|
|
54
54
|
if args.verbose:
|
|
@@ -59,7 +59,7 @@ def main():
|
|
|
59
59
|
else:
|
|
60
60
|
print(', '.join(parents))
|
|
61
61
|
else:
|
|
62
|
-
colour.error('
|
|
62
|
+
colour.error('Could not determine parent branch\n', prefix=True)
|
|
63
63
|
|
|
64
64
|
################################################################################
|
|
65
65
|
|
skilleter_thingy/git_review.py
CHANGED
|
@@ -228,7 +228,11 @@ class GitReview():
|
|
|
228
228
|
|
|
229
229
|
# Move to the top-level directory in the working tree
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
try:
|
|
232
|
+
self.current_dir = os.getcwd()
|
|
233
|
+
except FileNotFoundError:
|
|
234
|
+
raise GitReviewError('Unable to locate current directory')
|
|
235
|
+
|
|
232
236
|
self.working_tree_dir = git.working_tree()
|
|
233
237
|
|
|
234
238
|
if not self.working_tree_dir:
|
|
@@ -1309,13 +1313,13 @@ def parse_command_line():
|
|
|
1309
1313
|
# Make sure that we're actually in a git working tree
|
|
1310
1314
|
|
|
1311
1315
|
if not git.working_tree():
|
|
1312
|
-
colour.error('
|
|
1316
|
+
colour.error('Not a git repository', prefix=True)
|
|
1313
1317
|
|
|
1314
1318
|
# -C/--change is shorthand for '--commit HEAD^'
|
|
1315
1319
|
|
|
1316
1320
|
if args.change:
|
|
1317
1321
|
if args.commits:
|
|
1318
|
-
colour.error('
|
|
1322
|
+
colour.error('The -C/--change option does not take parameters', prefix=True)
|
|
1319
1323
|
|
|
1320
1324
|
args.commits = ['HEAD^']
|
|
1321
1325
|
|
|
@@ -1345,7 +1349,7 @@ def parse_command_line():
|
|
|
1345
1349
|
paths.append(entry)
|
|
1346
1350
|
parsing_commits = False
|
|
1347
1351
|
else:
|
|
1348
|
-
colour.error(f'
|
|
1352
|
+
colour.error(f'Invalid path/commit: {entry}', prefix=True)
|
|
1349
1353
|
|
|
1350
1354
|
args.commits = commits
|
|
1351
1355
|
args.paths = paths
|
|
@@ -1353,13 +1357,13 @@ def parse_command_line():
|
|
|
1353
1357
|
# Validate the commits & paths
|
|
1354
1358
|
|
|
1355
1359
|
if len(args.commits) > 2:
|
|
1356
|
-
colour.error('
|
|
1360
|
+
colour.error('No more than 2 commits can be specified', prefix=True)
|
|
1357
1361
|
|
|
1358
1362
|
if (args.branch or args.commit) and args.commits:
|
|
1359
|
-
colour.error('
|
|
1363
|
+
colour.error('Additional commits should not be specified in conjunction with the -b/--branch option', prefix=True)
|
|
1360
1364
|
|
|
1361
1365
|
if args.commit and args.branch:
|
|
1362
|
-
colour.error('
|
|
1366
|
+
colour.error('The -c/--commit and -b/--branch options are mutually exclusive', prefix=True)
|
|
1363
1367
|
|
|
1364
1368
|
# If the -c/--commit option is used, then review against its parent
|
|
1365
1369
|
# If the -b/--branch option is used, then review against the oldest common ancestor
|
|
@@ -1369,7 +1373,7 @@ def parse_command_line():
|
|
|
1369
1373
|
try:
|
|
1370
1374
|
args.commits = [git.find_common_ancestor('HEAD', args.branch)]
|
|
1371
1375
|
except git.GitError as exc:
|
|
1372
|
-
colour.error(
|
|
1376
|
+
colour.error(exc, status=exc.status, prefix=True)
|
|
1373
1377
|
|
|
1374
1378
|
elif args.commit:
|
|
1375
1379
|
args.commits = ['%s^' % args.commit, args.commit]
|
|
@@ -1387,9 +1391,9 @@ def parse_command_line():
|
|
|
1387
1391
|
if len(matches) == 1:
|
|
1388
1392
|
args.commits[i] = matches[0]
|
|
1389
1393
|
else:
|
|
1390
|
-
colour.error(f'
|
|
1394
|
+
colour.error(f'Multiple commits match {entry}', prefix=True)
|
|
1391
1395
|
else:
|
|
1392
|
-
colour.error(f'
|
|
1396
|
+
colour.error(f'{entry} is not a valid commit ID', prefix=True)
|
|
1393
1397
|
|
|
1394
1398
|
# Things work easier if we always have two commits to compare
|
|
1395
1399
|
|
skilleter_thingy/git_wt.py
CHANGED
|
@@ -26,15 +26,15 @@ def main():
|
|
|
26
26
|
parser = argparse.ArgumentParser(description='Report top-level directory of the current git working tree.')
|
|
27
27
|
parser.add_argument('--parent', '-p', action='store_true',
|
|
28
28
|
help='If we are already at the top of the working tree, check if the parent directory is in a working tree and output the top-level directory of that tree.')
|
|
29
|
-
parser.add_argument('--dir', '-d', action='store', default=
|
|
29
|
+
parser.add_argument('--dir', '-d', action='store', default=None,
|
|
30
30
|
help='Find the location of the top-level directory in the working tree starting at the specified directory')
|
|
31
31
|
|
|
32
32
|
args = parser.parse_args()
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
sys.stderr.write(
|
|
34
|
+
try:
|
|
35
|
+
start_dir = os.path.abspath(args.dir or os.getcwd())
|
|
36
|
+
except FileNotFoundError:
|
|
37
|
+
sys.stderr.write('Unable to determine initial directory\n')
|
|
38
38
|
sys.exit(1)
|
|
39
39
|
|
|
40
40
|
# Search for a .git directory in the current or parent directories
|
|
@@ -169,7 +169,12 @@ def main():
|
|
|
169
169
|
|
|
170
170
|
# Determine the best way of reporting the path to the file
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
try:
|
|
173
|
+
working_tree_path = os.getcwd()
|
|
174
|
+
except FileNotFoundError:
|
|
175
|
+
sys.stderr.write('Unable to get current working directory')
|
|
176
|
+
sys.exit(2)
|
|
177
|
+
|
|
173
178
|
current_path = os.path.join(working_tree_path, os.getenv('GIT_SUBDIR', ''))
|
|
174
179
|
|
|
175
180
|
current_file_path = os.path.relpath(args.file_path if args.new_name is None else args.new_name, current_path)
|
skilleter_thingy/gphotosync.py
CHANGED
|
@@ -94,7 +94,7 @@ def parse_yyyymm(datestr):
|
|
|
94
94
|
date_match = YYYY_MM_re.fullmatch(datestr)
|
|
95
95
|
|
|
96
96
|
if not date_match:
|
|
97
|
-
colour.error(f'
|
|
97
|
+
colour.error(f'Invalid date: {datestr}', prefix=True)
|
|
98
98
|
|
|
99
99
|
return datetime.date(int(date_match.group(1)), int(date_match.group(2)), day=1)
|
|
100
100
|
|
|
@@ -387,9 +387,9 @@ def update_cache(args, year, month):
|
|
|
387
387
|
|
|
388
388
|
subprocess.run(cmd, check=True)
|
|
389
389
|
except subprocess.CalledProcessError:
|
|
390
|
-
colour.error(f'
|
|
390
|
+
colour.error(f'Failed to sync Google photos for month [BLUE:{month}] of year [BLUE:{year}]', prefix=True)
|
|
391
391
|
except FileNotFoundError as exc:
|
|
392
|
-
colour.error(
|
|
392
|
+
colour.error(exc, prefix=True)
|
|
393
393
|
|
|
394
394
|
################################################################################
|
|
395
395
|
|
|
@@ -73,7 +73,7 @@ def parse_yyyymm(datestr):
|
|
|
73
73
|
date_match = YYYY_MM_re.fullmatch(datestr)
|
|
74
74
|
|
|
75
75
|
if not date_match:
|
|
76
|
-
colour.error(f'
|
|
76
|
+
colour.error(f'Invalid date: {datestr}', prefix=True)
|
|
77
77
|
|
|
78
78
|
return datetime.date(int(date_match.group(1)), int(date_match.group(2)), day=1)
|
|
79
79
|
|
|
@@ -97,7 +97,7 @@ def parse_command_line():
|
|
|
97
97
|
args = parser.parse_args()
|
|
98
98
|
|
|
99
99
|
if not args.path:
|
|
100
|
-
colour.error('You must specify a source directory')
|
|
100
|
+
colour.error('You must specify a source directory', prefix=True)
|
|
101
101
|
|
|
102
102
|
# Configure debugging
|
|
103
103
|
|
skilleter_thingy/multigit.py
CHANGED
|
@@ -133,14 +133,6 @@ class Arguments():
|
|
|
133
133
|
|
|
134
134
|
################################################################################
|
|
135
135
|
|
|
136
|
-
def error(msg, status=1):
|
|
137
|
-
"""Quit with an error"""
|
|
138
|
-
|
|
139
|
-
colour.write(f'[RED:ERROR:] {msg}\n', stream=sys.stderr)
|
|
140
|
-
sys.exit(status)
|
|
141
|
-
|
|
142
|
-
################################################################################
|
|
143
|
-
|
|
144
136
|
def verbose(args, msg):
|
|
145
137
|
"""Output a message to stderr if running verbosely"""
|
|
146
138
|
|
|
@@ -174,7 +166,11 @@ def find_configuration(default_config_file):
|
|
|
174
166
|
if '/' in default_config_file:
|
|
175
167
|
config_file = default_config_file
|
|
176
168
|
else:
|
|
177
|
-
|
|
169
|
+
try:
|
|
170
|
+
config_path = os.getcwd()
|
|
171
|
+
except FileNotFoundError:
|
|
172
|
+
colour.error('Unable to determine current directory', prefix=True)
|
|
173
|
+
|
|
178
174
|
config_file = os.path.join(config_path, default_config_file)
|
|
179
175
|
|
|
180
176
|
while not os.path.isfile(config_file) and config_path != '/':
|
|
@@ -314,10 +310,10 @@ def mg_clone(args, config, console):
|
|
|
314
310
|
# Sanity checks
|
|
315
311
|
|
|
316
312
|
if not args.parameters:
|
|
317
|
-
error('The "clone" subcommand takes 1 or 2 parameters - the repo to clone and, optionally, the branch to check out')
|
|
313
|
+
colour.error('The "clone" subcommand takes 1 or 2 parameters - the repo to clone and, optionally, the branch to check out', prefix=True)
|
|
318
314
|
|
|
319
315
|
if args.branched or args.modified:
|
|
320
|
-
error('The "modified" and "branched" options cannot be used with the "clone" subcommand')
|
|
316
|
+
colour.error('The "modified" and "branched" options cannot be used with the "clone" subcommand', prefix=True)
|
|
321
317
|
|
|
322
318
|
# Destination directory is the last portion of the repo URL with the extension removed
|
|
323
319
|
|
|
@@ -325,9 +321,9 @@ def mg_clone(args, config, console):
|
|
|
325
321
|
|
|
326
322
|
if os.path.exists(directory):
|
|
327
323
|
if os.path.isdir(directory):
|
|
328
|
-
error(f'The "[BLUE:{directory}]" directory already exists')
|
|
324
|
+
colour.error(f'The "[BLUE:{directory}]" directory already exists', prefix=True)
|
|
329
325
|
else:
|
|
330
|
-
error(f'[BLUE:{directory}]" already exists')
|
|
326
|
+
colour.error(f'[BLUE:{directory}]" already exists', prefix=True)
|
|
331
327
|
|
|
332
328
|
# Clone the repo and chdir into it
|
|
333
329
|
|
|
@@ -349,7 +345,7 @@ def mg_clone(args, config, console):
|
|
|
349
345
|
args.configuration_file = args.default_configuration_file
|
|
350
346
|
|
|
351
347
|
if not os.path.isfile(args.configuration_file):
|
|
352
|
-
error(f'Cannot find the configuration file: [BOLD:{args.default_configuration_file}]')
|
|
348
|
+
colour.error(f'Cannot find the configuration file: [BOLD:{args.default_configuration_file}]', prefix=True)
|
|
353
349
|
|
|
354
350
|
config.read(args.configuration_file)
|
|
355
351
|
|
|
@@ -383,7 +379,7 @@ def mg_init(args, config, console):
|
|
|
383
379
|
# Sanity checks
|
|
384
380
|
|
|
385
381
|
if args.modified or args.branched or args.tag or args.subdirectories:
|
|
386
|
-
error('The "--tag", "--modified" "--sub", and "--branched" options cannot be used with the "init" subcommand')
|
|
382
|
+
colour.error('The "--tag", "--modified" "--sub", and "--branched" options cannot be used with the "init" subcommand', prefix=True)
|
|
387
383
|
|
|
388
384
|
# Search for .git directories and add any that aren't already in the configuration
|
|
389
385
|
|
|
@@ -405,7 +401,7 @@ def mg_init(args, config, console):
|
|
|
405
401
|
default_branch = git.branch(path=abs_repo_path)
|
|
406
402
|
|
|
407
403
|
if not default_branch:
|
|
408
|
-
error(f'Unable to determine default branch in [BLUE:{repo}]')
|
|
404
|
+
colour.error(f'Unable to determine default branch in [BLUE:{repo}]', prefix=True)
|
|
409
405
|
|
|
410
406
|
config[repo]['default branch'] = default_branch
|
|
411
407
|
|
|
@@ -451,12 +447,12 @@ def mg_dir(args, config, console):
|
|
|
451
447
|
verbose(args, f'dir: Parameters: {", ".join(args.parameters)}')
|
|
452
448
|
|
|
453
449
|
if len(args.parameters) > 1:
|
|
454
|
-
error('The +dir command takes no more than one parameter - the name of the working tree to search for')
|
|
450
|
+
colour.error('The +dir command takes no more than one parameter - the name of the working tree to search for', prefix=True)
|
|
455
451
|
|
|
456
452
|
# TODO: mg_dir _should_ use these options
|
|
457
453
|
|
|
458
454
|
if args.modified or args.branched or args.tag or args.subdirectories:
|
|
459
|
-
error('The "--tag", "--modified" "--sub", and "--branched" options cannot be used with the "dir" subcommand')
|
|
455
|
+
colour.error('The "--tag", "--modified" "--sub", and "--branched" options cannot be used with the "dir" subcommand', prefix=True)
|
|
460
456
|
|
|
461
457
|
# If a parameter is specified, look for matches, otherwise just return the location of the
|
|
462
458
|
# configuration file
|
|
@@ -490,7 +486,7 @@ def mg_dir(args, config, console):
|
|
|
490
486
|
destination = destinations
|
|
491
487
|
|
|
492
488
|
if not destination:
|
|
493
|
-
error(f'No matches with [BLUE:{search_name}]')
|
|
489
|
+
colour.error(f'No matches with [BLUE:{search_name}]', prefix=True)
|
|
494
490
|
|
|
495
491
|
colour.write("\n".join([relative_repo_path(args, d) for d in destination]))
|
|
496
492
|
|
|
@@ -505,7 +501,7 @@ def mg_tag(args, config, console):
|
|
|
505
501
|
_ = console
|
|
506
502
|
|
|
507
503
|
if len(args.parameters) > 1:
|
|
508
|
-
error('The +tag command takes no more than one parameter')
|
|
504
|
+
colour.error('The +tag command takes no more than one parameter', prefix=True)
|
|
509
505
|
|
|
510
506
|
for repo in select_git_repos(args, config):
|
|
511
507
|
try:
|
|
@@ -529,7 +525,7 @@ def mg_untag(args, config, console):
|
|
|
529
525
|
_ = console
|
|
530
526
|
|
|
531
527
|
if len(args.parameters) > 1:
|
|
532
|
-
error('The +tag command takes no more than one parameter')
|
|
528
|
+
colour.error('The +tag command takes no more than one parameter', prefix=True)
|
|
533
529
|
|
|
534
530
|
for repo in select_git_repos(args, config):
|
|
535
531
|
try:
|
|
@@ -551,7 +547,7 @@ def mg_config(args, config, console):
|
|
|
551
547
|
_ = console
|
|
552
548
|
|
|
553
549
|
if len(args.parameters):
|
|
554
|
-
error('The +config command does not take parameters')
|
|
550
|
+
colour.error('The +config command does not take parameters', prefix=True)
|
|
555
551
|
|
|
556
552
|
colour.write(os.path.relpath(args.configuration_file))
|
|
557
553
|
|
|
@@ -614,28 +610,28 @@ def parse_command_line():
|
|
|
614
610
|
|
|
615
611
|
elif param in ('config', 'c'):
|
|
616
612
|
if params:
|
|
617
|
-
error('--config - missing configuration file parameter')
|
|
613
|
+
colour.error('--config - missing configuration file parameter', prefix=True)
|
|
618
614
|
else:
|
|
619
615
|
try:
|
|
620
616
|
args.default_configuration_file = arg_list.pop(0)
|
|
621
617
|
except IndexError:
|
|
622
|
-
error('--config - missing configuration file parameter')
|
|
618
|
+
colour.error('--config - missing configuration file parameter', prefix=True)
|
|
623
619
|
|
|
624
620
|
elif param in ('repos', 'r'):
|
|
625
621
|
if params:
|
|
626
|
-
error('--repos - missing repo parameter')
|
|
622
|
+
colour.error('--repos - missing repo parameter', prefix=True)
|
|
627
623
|
try:
|
|
628
624
|
args.repos.append(arg_list.pop(0))
|
|
629
625
|
except IndexError:
|
|
630
|
-
error('--repos - missing repo parameter')
|
|
626
|
+
colour.error('--repos - missing repo parameter', prefix=True)
|
|
631
627
|
|
|
632
628
|
elif param in ('tag', 't'):
|
|
633
629
|
if params:
|
|
634
|
-
error('--tag - missing tag parameter')
|
|
630
|
+
colour.error('--tag - missing tag parameter', prefix=True)
|
|
635
631
|
try:
|
|
636
632
|
args.tag.append(arg_list.pop(0))
|
|
637
633
|
except IndexError:
|
|
638
|
-
error('--tag - missing tag parameter')
|
|
634
|
+
colour.error('--tag - missing tag parameter', prefix=True)
|
|
639
635
|
|
|
640
636
|
elif param in ('modified', 'm'):
|
|
641
637
|
args.modified = True
|
|
@@ -654,7 +650,7 @@ def parse_command_line():
|
|
|
654
650
|
sys.exit(0)
|
|
655
651
|
|
|
656
652
|
else:
|
|
657
|
-
error(f'Invalid option: "{param}"')
|
|
653
|
+
colour.error(f'Invalid option: "{param}"', prefix=True)
|
|
658
654
|
|
|
659
655
|
# After the options, we either have a multigit command (prefixed with '+') or a git command
|
|
660
656
|
# followed by parameter
|
|
@@ -670,7 +666,7 @@ def parse_command_line():
|
|
|
670
666
|
args.internal_command = False
|
|
671
667
|
|
|
672
668
|
except IndexError:
|
|
673
|
-
error('Missing command')
|
|
669
|
+
colour.error('Missing command', prefix=True)
|
|
674
670
|
|
|
675
671
|
# Save the command parameters
|
|
676
672
|
|
|
@@ -702,7 +698,7 @@ def main():
|
|
|
702
698
|
args = parse_command_line()
|
|
703
699
|
|
|
704
700
|
if args.internal_command and args.command not in COMMANDS:
|
|
705
|
-
error(f'Invalid command "{args.command}"')
|
|
701
|
+
colour.error(f'Invalid command "{args.command}"', prefix=True)
|
|
706
702
|
|
|
707
703
|
# If the configuration file exists, read it
|
|
708
704
|
|
|
@@ -717,7 +713,7 @@ def main():
|
|
|
717
713
|
if args.command == 'init':
|
|
718
714
|
args.configuration_file = os.path.abspath(args.default_configuration_file)
|
|
719
715
|
else:
|
|
720
|
-
error('Cannot locate configuration file')
|
|
716
|
+
colour.error('Cannot locate configuration file', prefix=True)
|
|
721
717
|
|
|
722
718
|
if args.configuration_file and os.path.isfile(args.configuration_file):
|
|
723
719
|
config.read(args.configuration_file)
|
|
@@ -736,7 +732,7 @@ def main():
|
|
|
736
732
|
# Everything except '+init' and '+clone' requires the configuration file
|
|
737
733
|
|
|
738
734
|
if args.command not in ('init', 'clone') and args.configuration_file is None:
|
|
739
|
-
error('Configuration file not found')
|
|
735
|
+
colour.error('Configuration file not found', prefix=True)
|
|
740
736
|
|
|
741
737
|
COMMANDS[args.command](args, config, console)
|
|
742
738
|
|
|
@@ -184,9 +184,13 @@ def write(txt=None, newline=True, stream=sys.stdout, indent=0, strip=False, clea
|
|
|
184
184
|
|
|
185
185
|
################################################################################
|
|
186
186
|
|
|
187
|
-
def error(txt, newline=True, stream=sys.stderr, status=1):
|
|
187
|
+
def error(txt, newline=True, stream=sys.stderr, status=1, prefix=False):
|
|
188
188
|
""" Write an error message to the specified stream (defaulting to
|
|
189
|
-
stderr) and exit with the specified status code (defaulting to 1)
|
|
189
|
+
stderr) and exit with the specified status code (defaulting to 1)
|
|
190
|
+
Prefix the output with 'ERROR:' in red if prefix==True """
|
|
191
|
+
|
|
192
|
+
if prefix:
|
|
193
|
+
write('[RED:ERROR]: ', newline=False, stream=stream, )
|
|
190
194
|
|
|
191
195
|
write(txt, newline, stream)
|
|
192
196
|
|
skilleter_thingy/thingy/git.py
CHANGED
|
@@ -976,10 +976,10 @@ def author(commit):
|
|
|
976
976
|
|
|
977
977
|
################################################################################
|
|
978
978
|
|
|
979
|
-
def commit_changes(commit='HEAD'
|
|
979
|
+
def commit_changes(commit='HEAD'):
|
|
980
980
|
"""Return a list of the files changed in a commit"""
|
|
981
981
|
|
|
982
|
-
return git(['show', '--name-only', '--pretty=format:', commit]
|
|
982
|
+
return git(['show', '--name-only', '--pretty=format:', commit])
|
|
983
983
|
|
|
984
984
|
################################################################################
|
|
985
985
|
|
skilleter_thingy/trimpath.py
CHANGED
|
@@ -52,10 +52,11 @@ def main():
|
|
|
52
52
|
|
|
53
53
|
# Set the path, defaulting to the current directory
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
full_path = args.path
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
try:
|
|
56
|
+
full_path = args.path or os.getcwd()
|
|
57
|
+
except FileNotFoundError:
|
|
58
|
+
logging.critical('Unable to locate directory')
|
|
59
|
+
sys.exit(1)
|
|
59
60
|
|
|
60
61
|
trimmed = path.trimpath(full_path, trim_width)
|
|
61
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.19
|
|
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
|
|
@@ -4,29 +4,29 @@ skilleter_thingy/borger.py,sha256=voCEgxl-LdDMpCmBxSv3x0XnO9goalO0_T98pM1dqn8,79
|
|
|
4
4
|
skilleter_thingy/console_colours.py,sha256=BOS9mo3jChx_FE8L1j488MDoVNgib11KjTRhrz_YRYE,1781
|
|
5
5
|
skilleter_thingy/diskspacecheck.py,sha256=7xsj4egXXV6jPhXZTe2b5rS03XAmm5uLC5TeiO1NJoE,2072
|
|
6
6
|
skilleter_thingy/docker_purge.py,sha256=PRQ7EBXymjYIHuJL4pk4r6KNn09IF28OGZ0ln57xtNg,3314
|
|
7
|
-
skilleter_thingy/ffind.py,sha256=
|
|
8
|
-
skilleter_thingy/ggit.py,sha256=
|
|
7
|
+
skilleter_thingy/ffind.py,sha256=rEgotUaMj9JxDCwz-7H5vdqxH_bXllaHqttwsOUGKj8,19235
|
|
8
|
+
skilleter_thingy/ggit.py,sha256=BL-DhNcz4Nd3sA-3Kl6gZ-zFtbNqOpyufvas-0aD8nk,2465
|
|
9
9
|
skilleter_thingy/ggrep.py,sha256=0zFyo9pxmYCuWrJgcH3Sj2hr7qOi02ijQuJ5teLbvCI,5863
|
|
10
|
-
skilleter_thingy/git_br.py,sha256
|
|
10
|
+
skilleter_thingy/git_br.py,sha256=fu2rk0g9ymUImxvKwaK0gNWIxv8ADXNeDGTnLEkAEBY,5794
|
|
11
11
|
skilleter_thingy/git_ca.py,sha256=ajPpmVsOsvBfMnf2P_8irUAa5N4a3cFQgLjN-by5LSg,4932
|
|
12
12
|
skilleter_thingy/git_cleanup.py,sha256=8PAxf3ZeKYYAuiBZNHQrKd_PlYYs9_-OwrIWFCC8_xg,10201
|
|
13
13
|
skilleter_thingy/git_co.py,sha256=0i8bOHJIA4zhyy_KWVWh8HbbEuQCKUAxASGZOdr_SYY,8205
|
|
14
|
-
skilleter_thingy/git_common.py,sha256=
|
|
15
|
-
skilleter_thingy/git_hold.py,sha256=
|
|
14
|
+
skilleter_thingy/git_common.py,sha256=KCM5HcPEvOonClKfkY9vRcBFbHicRh7L17ysrGrQ5CI,1874
|
|
15
|
+
skilleter_thingy/git_hold.py,sha256=EkIHzubG7BsR-Vv-UCj8rl-9Hx7ft31t7IEf1nGW6WE,4616
|
|
16
16
|
skilleter_thingy/git_mr.py,sha256=g33FaRtJTbIQI0tfXv_a042YpGwtbg5fKw072aqjAdw,3086
|
|
17
|
-
skilleter_thingy/git_parent.py,sha256=
|
|
17
|
+
skilleter_thingy/git_parent.py,sha256=iNSJQdUkg-GLh1pxVZuzYgINisSV2SZWnPla33bCRtY,2776
|
|
18
18
|
skilleter_thingy/git_retag.py,sha256=70rbybb1M2sCUblmD2-iLVG0xdFq-Bl5HG0U1LRnAvs,1442
|
|
19
|
-
skilleter_thingy/git_review.py,sha256=
|
|
19
|
+
skilleter_thingy/git_review.py,sha256=S4o_CJ6GPGGu7nvy43nmJWyNXNEnf_Zu3MO2IOacppM,52574
|
|
20
20
|
skilleter_thingy/git_update.py,sha256=nw-bnDFrMi7yNf7P6gGF8gzmJUjXU5PhWhOYPgApcX4,14350
|
|
21
|
-
skilleter_thingy/git_wt.py,sha256=
|
|
22
|
-
skilleter_thingy/gitcmp_helper.py,sha256=
|
|
21
|
+
skilleter_thingy/git_wt.py,sha256=93mbh8AKej8_y3aL6mVxKjKLEqMczaDtHoYcWf70eU0,2231
|
|
22
|
+
skilleter_thingy/gitcmp_helper.py,sha256=NgQ0BZfa4TVA-XV6YKvrm5147boWUpGw-jDPUsktiMg,11346
|
|
23
23
|
skilleter_thingy/gitprompt.py,sha256=SzSMd0EGI7ftPko80Q2PipwbVA-qjU1jsmdpmTCM5GI,8912
|
|
24
24
|
skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
|
|
25
|
-
skilleter_thingy/gphotosync.py,sha256=
|
|
25
|
+
skilleter_thingy/gphotosync.py,sha256=VZCqtsOwQVPwH_o9tdETcFrPtgvyH8YDeK3uOHrqJK8,22478
|
|
26
26
|
skilleter_thingy/linecount.py,sha256=ehTN6VD76i4U5k6dXuYoiqSRHI67_BP-bziklNAJSKY,4309
|
|
27
|
-
skilleter_thingy/localphotosync.py,sha256=
|
|
27
|
+
skilleter_thingy/localphotosync.py,sha256=D5-EgNTNLYfcEOst3mFUylk3aNABVfDS8NrVPhdNnQA,15941
|
|
28
28
|
skilleter_thingy/moviemover.py,sha256=QzUAWQzQ1AWWREIhl-VMaLo2h8MMhOekBnao5jGWV1s,4470
|
|
29
|
-
skilleter_thingy/multigit.py,sha256=
|
|
29
|
+
skilleter_thingy/multigit.py,sha256=mrbUDHRRsRPiJF3_IudZISN3gfg_mqrTPjlbRIh99jw,29098
|
|
30
30
|
skilleter_thingy/photodupe.py,sha256=l0hbzSLb2Vk2ceteg-x9fHXCEE1uUuFo84hz5rsZUPA,4184
|
|
31
31
|
skilleter_thingy/phototidier.py,sha256=BOu-cKHMivDlBqlRqv7sL3J6Ix1K2dxWWNcderldyZo,7818
|
|
32
32
|
skilleter_thingy/py_audit.py,sha256=xJm5k5qyeA6ii8mODa4dOkmP8L1drv94UHuxR54RsIM,4384
|
|
@@ -39,20 +39,20 @@ skilleter_thingy/strreplace.py,sha256=zMhqC38KF0BddTsRM5Pa99HU3KXvxXg942qxRK-LAL
|
|
|
39
39
|
skilleter_thingy/sysmon.py,sha256=XRZG6EVSzoVYan_N16qVB1l1RaU51uvLWlRA0CDjC54,11348
|
|
40
40
|
skilleter_thingy/tfm.py,sha256=xMsqcuNJ32PwKF5vO3SO6etlbJKbCLUJhSdC2w0clwE,33829
|
|
41
41
|
skilleter_thingy/tfparse.py,sha256=u1IZH2J_WH1aORyMozKSI2JKok7_S1MMJhiobzmhlUI,2988
|
|
42
|
-
skilleter_thingy/trimpath.py,sha256=
|
|
42
|
+
skilleter_thingy/trimpath.py,sha256=ctbV4iydncasuu41qRAmQbuCSUk72dxLUvbSRjEsHKk,2363
|
|
43
43
|
skilleter_thingy/venv_create.py,sha256=lMcGvWNwP-ZlyPJ1eZU-PHNOnscZHjtjhoT6sLfhIU4,1153
|
|
44
44
|
skilleter_thingy/window_rename.py,sha256=dCBgZqih_3YKHt35hsOAhARFp3QxOi8w8huC63sqJK8,3128
|
|
45
45
|
skilleter_thingy/xchmod.py,sha256=T89xiH_po0nvH5T1AGgQOD5yhjKd9-LcHcmez3IORww,4604
|
|
46
46
|
skilleter_thingy/yamlcheck.py,sha256=FXylZ5NtHirDlPVhVEUZUZkTugVR-g51BbjaN06akAc,2868
|
|
47
47
|
skilleter_thingy/thingy/__init__.py,sha256=rVPTxm8L5w52U0YdTd7r_D44SBP7pS3JCJtsf0iIsow,110
|
|
48
|
-
skilleter_thingy/thingy/colour.py,sha256=
|
|
48
|
+
skilleter_thingy/thingy/colour.py,sha256=EjMA2iN7B7MFBQI47wdaMuPrY3fsFa1buWwlDFP2zx8,7568
|
|
49
49
|
skilleter_thingy/thingy/dc_curses.py,sha256=fuuQPR11zV_akAhygL_cAhVLC5YAgKgowzlITVbETE8,8539
|
|
50
50
|
skilleter_thingy/thingy/dc_defaults.py,sha256=ahcteQvoWZrO5iTU68zkIY1Zex6iX5uR5ubwI4CCYBk,6170
|
|
51
51
|
skilleter_thingy/thingy/dc_util.py,sha256=Df73imXhHx3HzcPHiRcHAoea0e3HURdLcrolUsMhOFs,1783
|
|
52
52
|
skilleter_thingy/thingy/dircolors.py,sha256=5NbXMsGWdABLvvZfB70VPmN6N5HyyihfpgoQq1NRJbg,12264
|
|
53
53
|
skilleter_thingy/thingy/docker.py,sha256=9EFatudoVPfB1UbDEtzdJDB3o6ToHiNHv8-oLsUeqiQ,2449
|
|
54
54
|
skilleter_thingy/thingy/files.py,sha256=oW6E6WWwVFSUPdrZnKMx7P_w_hh3etjoN7RrqvYHCHc,4705
|
|
55
|
-
skilleter_thingy/thingy/git.py,sha256=
|
|
55
|
+
skilleter_thingy/thingy/git.py,sha256=d7pVv9M6k_xay3DU8-F1UxMWrN2xs1PWc7UOVvCM7Ys,39146
|
|
56
56
|
skilleter_thingy/thingy/git2.py,sha256=ZzAq3DvJS91E4ahJA5eQDx0ejeXbFv7sk8xy_iB-ue8,37895
|
|
57
57
|
skilleter_thingy/thingy/gitlab.py,sha256=uXAF918xnPk6qQyiwPQDbMZfqtJzhiRqDS7yEtJEIAg,6079
|
|
58
58
|
skilleter_thingy/thingy/path.py,sha256=8uM2Q9zFRWv_SaVOX49PeecQXttl7J6lsmBuRXWsXKY,4732
|
|
@@ -62,9 +62,9 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
|
|
|
62
62
|
skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
|
|
63
63
|
skilleter_thingy/thingy/tidy.py,sha256=UWpBWuIMCE1UonLJErb41yW3RtpXrK_bt4Z4cZR-eDU,5910
|
|
64
64
|
skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
|
|
65
|
-
skilleter_thingy-0.1.
|
|
66
|
-
skilleter_thingy-0.1.
|
|
67
|
-
skilleter_thingy-0.1.
|
|
68
|
-
skilleter_thingy-0.1.
|
|
69
|
-
skilleter_thingy-0.1.
|
|
70
|
-
skilleter_thingy-0.1.
|
|
65
|
+
skilleter_thingy-0.1.19.dist-info/licenses/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
|
|
66
|
+
skilleter_thingy-0.1.19.dist-info/METADATA,sha256=gUVlCCucreknlo2-cfUl_e6G_5tKiRHp04N17oz3UBE,29914
|
|
67
|
+
skilleter_thingy-0.1.19.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
68
|
+
skilleter_thingy-0.1.19.dist-info/entry_points.txt,sha256=mklrWFvNKw9Hyem9RG3x0PoVYjlx2fDnJ3xWMTMOmfs,2258
|
|
69
|
+
skilleter_thingy-0.1.19.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
|
|
70
|
+
skilleter_thingy-0.1.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|