skilleter-thingy 0.3.0__tar.gz → 0.3.1__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 (60) hide show
  1. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/PKG-INFO +1 -19
  2. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/README.md +0 -18
  3. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/pyproject.toml +1 -2
  4. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy.egg-info/PKG-INFO +1 -19
  5. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy.egg-info/SOURCES.txt +0 -2
  6. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy.egg-info/entry_points.txt +0 -1
  7. skilleter_thingy-0.3.0/skilleter_thingy/docker_purge.py +0 -112
  8. skilleter_thingy-0.3.0/skilleter_thingy/thingy/docker.py +0 -105
  9. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/LICENSE +0 -0
  10. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/setup.cfg +0 -0
  11. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/__init__.py +0 -0
  12. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/addpath.py +0 -0
  13. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/console_colours.py +0 -0
  14. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/ffind.py +0 -0
  15. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/ggit.py +0 -0
  16. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/ggrep.py +0 -0
  17. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_br.py +0 -0
  18. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_ca.py +0 -0
  19. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_cleanup.py +0 -0
  20. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_co.py +0 -0
  21. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_common.py +0 -0
  22. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_hold.py +0 -0
  23. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_parent.py +0 -0
  24. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_retag.py +0 -0
  25. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_review.py +0 -0
  26. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_update.py +0 -0
  27. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/git_wt.py +0 -0
  28. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/gitcmp_helper.py +0 -0
  29. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/gitprompt.py +0 -0
  30. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/linecount.py +0 -0
  31. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/multigit.py +0 -0
  32. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/py_audit.py +0 -0
  33. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/readable.py +0 -0
  34. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/remdir.py +0 -0
  35. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/rpylint.py +0 -0
  36. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/strreplace.py +0 -0
  37. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/tfm.py +0 -0
  38. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/tfparse.py +0 -0
  39. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/__init__.py +0 -0
  40. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/colour.py +0 -0
  41. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/dc_curses.py +0 -0
  42. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/dc_defaults.py +0 -0
  43. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/dc_util.py +0 -0
  44. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/dircolors.py +0 -0
  45. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/files.py +0 -0
  46. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/git.py +0 -0
  47. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/gitlab.py +0 -0
  48. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/path.py +0 -0
  49. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/popup.py +0 -0
  50. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/run.py +0 -0
  51. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/tfm_pane.py +0 -0
  52. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/tidy.py +0 -0
  53. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/thingy/venv_template.py +0 -0
  54. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/trimpath.py +0 -0
  55. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/venv_create.py +0 -0
  56. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/xchmod.py +0 -0
  57. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy/yamlcheck.py +0 -0
  58. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
  59. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/skilleter_thingy.egg-info/requires.txt +0 -0
  60. {skilleter_thingy-0.3.0 → skilleter_thingy-0.3.1}/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.3.0
3
+ Version: 0.3.1
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
@@ -407,24 +407,6 @@ Add or remove entries from a path list (e.g. as used by the PATH environment var
407
407
 
408
408
  Display all available colours in the console.
409
409
 
410
- ## docker-purge
411
-
412
- Stop or kill docker instances and/or remove docker images.
413
-
414
- docker-purge [-h] [--stop] [--kill] [--remove] [--list] [--force] [--debug] [images ...]
415
-
416
- positional arguments:
417
- images List of Docker containers (regular expression)
418
-
419
- options:
420
- -h, --help show this help message and exit
421
- --stop, -s Stop Docker instances
422
- --kill, -k Kill Docker instances
423
- --remove, -r Remove Docker images
424
- --list, -l List what would be done without doing it
425
- --force, -f Forcibly kill/remove instances
426
- --debug Enable debug output
427
-
428
410
  ## ffind
429
411
 
430
412
  Simple file find utility - replaces the `find` command with something that is more human-friendly.
@@ -384,24 +384,6 @@ Add or remove entries from a path list (e.g. as used by the PATH environment var
384
384
 
385
385
  Display all available colours in the console.
386
386
 
387
- ## docker-purge
388
-
389
- Stop or kill docker instances and/or remove docker images.
390
-
391
- docker-purge [-h] [--stop] [--kill] [--remove] [--list] [--force] [--debug] [images ...]
392
-
393
- positional arguments:
394
- images List of Docker containers (regular expression)
395
-
396
- options:
397
- -h, --help show this help message and exit
398
- --stop, -s Stop Docker instances
399
- --kill, -k Kill Docker instances
400
- --remove, -r Remove Docker images
401
- --list, -l List what would be done without doing it
402
- --force, -f Forcibly kill/remove instances
403
- --debug Enable debug output
404
-
405
387
  ## ffind
406
388
 
407
389
  Simple file find utility - replaces the `find` command with something that is more human-friendly.
@@ -7,7 +7,7 @@ name = "skilleter_thingy"
7
7
 
8
8
  # Version must be incremented to install updated Thingy
9
9
 
10
- version = "0.3.0"
10
+ version = "0.3.1"
11
11
 
12
12
  authors = [
13
13
  {name="John Skilleter", email="john@skilleter.org.uk"},
@@ -43,7 +43,6 @@ Home = "https://skilleter.org.uk"
43
43
  [project.scripts]
44
44
  addpath = "skilleter_thingy:addpath.addpath"
45
45
  consolecolours = "skilleter_thingy:console_colours.console_colours"
46
- docker-purge = "skilleter_thingy:docker_purge.docker_purge"
47
46
  ffind = "skilleter_thingy:ffind.ffind"
48
47
  ggit = "skilleter_thingy:ggit.ggit"
49
48
  ggrep = "skilleter_thingy:ggrep.ggrep"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilleter_thingy
3
- Version: 0.3.0
3
+ Version: 0.3.1
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
@@ -407,24 +407,6 @@ Add or remove entries from a path list (e.g. as used by the PATH environment var
407
407
 
408
408
  Display all available colours in the console.
409
409
 
410
- ## docker-purge
411
-
412
- Stop or kill docker instances and/or remove docker images.
413
-
414
- docker-purge [-h] [--stop] [--kill] [--remove] [--list] [--force] [--debug] [images ...]
415
-
416
- positional arguments:
417
- images List of Docker containers (regular expression)
418
-
419
- options:
420
- -h, --help show this help message and exit
421
- --stop, -s Stop Docker instances
422
- --kill, -k Kill Docker instances
423
- --remove, -r Remove Docker images
424
- --list, -l List what would be done without doing it
425
- --force, -f Forcibly kill/remove instances
426
- --debug Enable debug output
427
-
428
410
  ## ffind
429
411
 
430
412
  Simple file find utility - replaces the `find` command with something that is more human-friendly.
@@ -4,7 +4,6 @@ pyproject.toml
4
4
  skilleter_thingy/__init__.py
5
5
  skilleter_thingy/addpath.py
6
6
  skilleter_thingy/console_colours.py
7
- skilleter_thingy/docker_purge.py
8
7
  skilleter_thingy/ffind.py
9
8
  skilleter_thingy/ggit.py
10
9
  skilleter_thingy/ggrep.py
@@ -46,7 +45,6 @@ skilleter_thingy/thingy/dc_curses.py
46
45
  skilleter_thingy/thingy/dc_defaults.py
47
46
  skilleter_thingy/thingy/dc_util.py
48
47
  skilleter_thingy/thingy/dircolors.py
49
- skilleter_thingy/thingy/docker.py
50
48
  skilleter_thingy/thingy/files.py
51
49
  skilleter_thingy/thingy/git.py
52
50
  skilleter_thingy/thingy/gitlab.py
@@ -1,7 +1,6 @@
1
1
  [console_scripts]
2
2
  addpath = skilleter_thingy:addpath.addpath
3
3
  consolecolours = skilleter_thingy:console_colours.console_colours
4
- docker-purge = skilleter_thingy:docker_purge.docker_purge
5
4
  ffind = skilleter_thingy:ffind.ffind
6
5
  ggit = skilleter_thingy:ggit.ggit
7
6
  ggrep = skilleter_thingy:ggrep.ggrep
@@ -1,112 +0,0 @@
1
- #! /usr/bin/env python3
2
-
3
- ################################################################################
4
- """ Thingy docker-purge command
5
-
6
- Copyright (C) 2017 John Skilleter
7
-
8
- Initial version - contains only basic error checking and limited debug output.
9
- """
10
- ################################################################################
11
-
12
- import sys
13
- import re
14
- import argparse
15
- import logging
16
-
17
- from thingy import docker
18
-
19
- ################################################################################
20
-
21
- def initialise():
22
- """ Parse the command line """
23
-
24
- breakpoint()
25
- parser = argparse.ArgumentParser(description='Purge docker instances and images')
26
-
27
- parser.add_argument('--stop', '-s', action='store_true', help='Stop Docker instances')
28
- parser.add_argument('--kill', '-k', action='store_true', help='Kill Docker instances')
29
- parser.add_argument('--remove', '-r', action='store_true', help='Remove Docker images')
30
- parser.add_argument('--list', '-l', action='store_true', help='List what would be done without doing it')
31
- parser.add_argument('--force', '-f', action='store_true', help='Forcibly kill/remove instances')
32
- parser.add_argument('--debug', action='store_true', help='Enable debug output')
33
- parser.add_argument('images', nargs='*', help='List of Docker containers (regular expression)')
34
-
35
- args = parser.parse_args()
36
-
37
- # Configure logging
38
-
39
- if args.debug:
40
- logging.basicConfig(level=logging.DEBUG)
41
- logging.info('Debug logging enabled')
42
-
43
- # Default is to stop matching images
44
-
45
- if not args.stop and not args.kill and not args.remove:
46
- args.stop = True
47
-
48
- # Default is to match all containers
49
-
50
- if not args.images:
51
- args.images = '.*'
52
- else:
53
- args.images = '|'.join(args.images)
54
-
55
- logging.info('Arguments: %s', args)
56
- return args
57
-
58
- ################################################################################
59
-
60
- def main(args):
61
- """ Main code """
62
-
63
- try:
64
- if args.stop or args.kill:
65
- for instance in docker.instances():
66
- if re.match(args.images, instance):
67
-
68
- print(f'Stopping instance: {instance}')
69
-
70
- if not args.list:
71
- docker.stop(instance, force=args.force)
72
-
73
- if args.kill:
74
- for instance in docker.instances(all=True):
75
- if re.match(args.images, instance):
76
-
77
- print(f'Removing instance: {instance}')
78
-
79
- if not args.list:
80
- docker.rm(instance)
81
-
82
- if args.remove:
83
- for image in docker.images():
84
- if re.match(args.images, image):
85
-
86
- print(f'Removing image: {image}')
87
-
88
- if not args.list:
89
- docker.rmi(image, force=args.force)
90
-
91
- except docker.DockerError as exc:
92
- sys.stderr.write(f'{str(exc)}\n')
93
- sys.exit(1)
94
-
95
- ################################################################################
96
-
97
- def docker_purge():
98
- """Entry point"""
99
-
100
- try:
101
- config = initialise()
102
- main(config)
103
-
104
- except KeyboardInterrupt:
105
- sys.exit(1)
106
- except BrokenPipeError:
107
- sys.exit(2)
108
-
109
- ################################################################################
110
-
111
- if __name__ == '__main__':
112
- docker_purge()
@@ -1,105 +0,0 @@
1
- #! /usr/bin/env python3
2
-
3
- ################################################################################
4
- """ Docker interface for Thingy
5
-
6
- Copyright (C) 2017 John Skilleter
7
-
8
- Note that this:
9
- * Only implements functions required by docker-purge
10
- * Only has basic error checking, in that it raises DockerError
11
- for any error returned by the external docker command.
12
- """
13
- ################################################################################
14
-
15
- import subprocess
16
-
17
- ################################################################################
18
-
19
- class DockerError(Exception):
20
- """ Exception for dockery things """
21
-
22
- pass
23
-
24
- ################################################################################
25
-
26
- def instances(all=False):
27
- """ Return a list of all current Docker instances """
28
-
29
- cmd = ['docker', 'ps', '-q']
30
-
31
- if all:
32
- cmd.append('-a')
33
-
34
- instances_list = []
35
- try:
36
- process = subprocess.run(cmd, capture_output=True, check=True, text=True)
37
-
38
- for result in process.stdout:
39
- instances_list.append(result)
40
-
41
- except subprocess.CalledProcessError as exc:
42
- raise DockerError(exc)
43
-
44
- return instances_list
45
-
46
- ################################################################################
47
-
48
- def stop(instance, force=False):
49
- """ Stop the specified Docker instance """
50
-
51
- # TODO: force option not implemented
52
-
53
- try:
54
- subprocess.run(['docker', 'stop', instance], check=True, capture_output=False)
55
-
56
- except suprocess.CalledProcessError as exc:
57
- raise DockerError(exc)
58
-
59
- ################################################################################
60
-
61
- def rm(instance, force=False):
62
- """ Remove the specified instance """
63
-
64
- cmd = ['docker', 'rm']
65
-
66
- if force:
67
- cmd.append('--force')
68
-
69
- cmd.append(instance)
70
-
71
- try:
72
- subprocess.run(cmd, check=True, capture_output=False)
73
-
74
- except subprocess.CalledProcessError as exc:
75
- raise DockerError(exc)
76
-
77
- ################################################################################
78
-
79
- def images():
80
- """ Return a list of all current Docker images """
81
-
82
- try:
83
- process = subprocess.run(['docker', 'images', '-q'], capture_output=True, check=True)
84
-
85
- for result in process:
86
- yield result
87
-
88
- except subprocess.CalledProcessError as exc:
89
- raise DockerError(exc)
90
-
91
- ################################################################################
92
-
93
- def rmi(image, force=False):
94
- """ Remove the specified image """
95
-
96
- cmd = ['docker', 'rmi']
97
- if force:
98
- cmd.append('--force')
99
-
100
- cmd.append(image)
101
-
102
- try:
103
- subprocess.run(cmd, capture_output=False, check=True)
104
- except subprocess.CalledProcessError as exc:
105
- raise DockerError(exc)