skilleter-thingy 0.2.1__py3-none-any.whl → 0.2.3__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 (34) hide show
  1. skilleter_thingy/ggit.py +0 -1
  2. skilleter_thingy/ggrep.py +0 -1
  3. skilleter_thingy/git_br.py +0 -7
  4. skilleter_thingy/git_ca.py +0 -8
  5. skilleter_thingy/git_cleanup.py +0 -11
  6. skilleter_thingy/git_co.py +3 -8
  7. skilleter_thingy/git_common.py +4 -12
  8. skilleter_thingy/git_hold.py +0 -9
  9. skilleter_thingy/git_mr.py +0 -11
  10. skilleter_thingy/git_parent.py +18 -23
  11. skilleter_thingy/git_retag.py +0 -10
  12. skilleter_thingy/git_retag.sync-conflict-20250928-192600-TVSLRWK.py +54 -0
  13. skilleter_thingy/git_review.py +0 -1
  14. skilleter_thingy/git_update.py +0 -1
  15. skilleter_thingy/git_wt.py +0 -2
  16. skilleter_thingy/gitprompt.py +0 -1
  17. skilleter_thingy/thingy/git.py +5 -18
  18. skilleter_thingy/thingy/git2.py +7 -20
  19. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/METADATA +1 -46
  20. skilleter_thingy-0.2.3.dist-info/PKG-INFO 2 +193 -0
  21. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/RECORD +25 -32
  22. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/entry_points.txt +0 -9
  23. skilleter_thingy/borger.py +0 -273
  24. skilleter_thingy/diskspacecheck.py +0 -67
  25. skilleter_thingy/localphotosync.py +0 -201
  26. skilleter_thingy/moviemover.py +0 -133
  27. skilleter_thingy/photodupe.py +0 -135
  28. skilleter_thingy/phototidier.py +0 -248
  29. skilleter_thingy/splitpics.py +0 -99
  30. skilleter_thingy/sysmon.py +0 -435
  31. skilleter_thingy/window_rename.py +0 -92
  32. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/WHEEL +0 -0
  33. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/licenses/LICENSE +0 -0
  34. {skilleter_thingy-0.2.1.dist-info → skilleter_thingy-0.2.3.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilleter_thingy
3
- Version: 0.2.1
3
+ Version: 0.2.3
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
@@ -597,55 +597,10 @@ YAML validator - checks that a file is valid YAML (use yamllint to verify that i
597
597
 
598
598
  These will be moved to the skilleter-extras package in due course.
599
599
 
600
- ## borger
601
-
602
- Wrapper for the borg backup utility to make it easier to use with a fixed set of options.
603
-
604
600
  ## consolecolours
605
601
 
606
602
  Display all available colours in the console.
607
603
 
608
- ## diskspacecheck
609
-
610
- Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.
611
-
612
- Issue a warning if any are above 90% used.
613
-
614
- ## gphotosync & localphotosync
615
-
616
- Utilities for syncing photos from Google Photos or a local directory to local storage
617
-
618
- ## moviemover
619
-
620
- Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree
621
-
622
- ## phototidier
623
-
624
- Perform various tidying operations on a directory full of photos:
625
-
626
- * Remove leading '$' and '_' from filenames
627
- * Move files in hidden directories up 1 level
628
- * If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.
629
-
630
- All move/rename operations are carried out safely with the file being moved having
631
- a numeric suffix added to the name if it conflicts with an existing file.
632
-
633
- ## photodupe
634
-
635
- Search for duplicate images in a directory tree
636
-
637
- ## splitpics
638
-
639
- Copy a directory full of pictures to a destination, creating subdiretories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.
640
-
641
- ## sysmon
642
-
643
- Simple console system monitor
644
-
645
- ## window-rename
646
-
647
- Monitor window titles and rename them to fit an alphabetical grouping in 'Appname - Document' format.
648
-
649
604
  # Obsolescent Commands
650
605
 
651
606
  These commands will probably be retired in future versions of Thingy
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.1
2
+ Name: skilleter_thingy
3
+ Version: 0.0.49
4
+ Summary: A collection of useful utilities, mainly aimed at making Git more friendly
5
+ Author-email: John Skilleter <john@skilleter.org.uk>
6
+ Project-URL: Home, https://skilleter.org.uk
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: imagehash
14
+ Requires-Dist: inotify
15
+ Requires-Dist: pillow
16
+ Requires-Dist: psutil
17
+ Requires-Dist: pyaml
18
+ Requires-Dist: pygit2
19
+ Requires-Dist: python-dateutil
20
+ Requires-Dist: requests
21
+
22
+ # Thingy
23
+
24
+ Licence: GPL v3
25
+
26
+ Author: John Skilleter v0.99
27
+
28
+ Collection of shell utilities and configuration stuff for Linux and MacOS. Untested on other operating systems.
29
+
30
+ Permanently (for the forseeable future!) in a beta stage - usable, with a few rough edges, and probably with bugs when used in way I'm not expecting!
31
+
32
+ The following commands are documented in detail in the help output that can be displayed by running the command with the '--help' option.
33
+
34
+ This README just contains a summary of the functionality of each command.
35
+
36
+ # General Commands
37
+
38
+ ## addpath
39
+
40
+ Update a $PATH-type variable by adding or removing entries.
41
+
42
+ ## borger
43
+
44
+ Wrapper for the borg backup utility to make it easier to use with a fixed set of options.
45
+
46
+ ## console-colours
47
+
48
+ Display all available colours in the console.
49
+
50
+ ## diskspacecheck
51
+
52
+ Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.
53
+
54
+ Issue a warning if any are above 90% used.
55
+
56
+ ## docker-purge
57
+
58
+ Stop or kill docker instances and/or remove docker images.
59
+
60
+ ## ffind
61
+
62
+ Simple file find utility
63
+
64
+ Implements the functionality of the find command that is regularly used in a simpler fashion and ignores all the options that nobody ever uses.
65
+
66
+ ## gl
67
+
68
+ ### gphotosync
69
+
70
+ Utility for syncing photos from Google Photos to local storage
71
+
72
+ ## linecount
73
+
74
+ Count lines of code in a directory tree organised by file type.
75
+
76
+ ## moviemover
77
+
78
+ Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree
79
+
80
+ ## phototidier
81
+
82
+ Perform various tidying operations on a directory full of photos:
83
+
84
+ * Remove leading '$' and '_' from filenames
85
+ * Move files in hidden directories up 1 level
86
+ * If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.
87
+
88
+ All move/rename operations are carried out safely with the file being moved having
89
+ a numeric suffix added to the name if it conflicts with an existing file.
90
+
91
+ ## photodupe
92
+
93
+ ## py-audit
94
+
95
+ Query api.osv.dev to determine whether a specified version of a particular Python package is subject to known security vulnerabilities
96
+
97
+ ## readable
98
+
99
+ Pipe for converting colour combinations to make them readable on a light background
100
+
101
+ ## remdir
102
+
103
+ Recursively delete empty directories
104
+
105
+ ## rmdupe
106
+
107
+ Search for duplicate files
108
+
109
+ ## rpylint
110
+
111
+ Run pylint on all the Python source files in the current tree
112
+
113
+ ## s3-sync
114
+
115
+ Synchronise files from S3 to local storage.
116
+
117
+ ## splitpics
118
+
119
+ Copy a directory full of pictures to a destination, creating subdiretories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.
120
+
121
+ ## strreplace
122
+
123
+ Simple search and replace utility for those times when trying to escape characters in a regexp to use sed is more hassle than it is worth.
124
+
125
+ ## sysmon
126
+
127
+ ## tfm
128
+
129
+ Console-based file-manager, similar to Midnight Commander but better.
130
+
131
+ ## tfparse
132
+
133
+ Read JSON Terraform output and convert back to human-readable text
134
+ This allows multiple errors and warnings to be reported as there's
135
+ no way of doing this directly from Terraform
136
+
137
+ ## trimpath
138
+
139
+ Intelligently trim a path to fit a given width (used by gitprompt)
140
+
141
+ ## window-rename
142
+
143
+ ## xchmod
144
+
145
+ WIP: Command to run chmod only on files that need it (only modifies files that don't have the required permissions already).
146
+
147
+ Currently implements a *very* restricted set of functionality.
148
+
149
+ ## yamlcheck
150
+
151
+ YAML validator - checks that a file is valid YAML (use yamllint to verify that it is nicely-formatted YAML).
152
+
153
+ # Git Utilities
154
+
155
+ ## ggit
156
+
157
+ Run a git command in all repos under the current directory
158
+
159
+ ## ggrep
160
+
161
+ Run 'git grep' in all repos under the current directory
162
+
163
+ ## gitprompt
164
+
165
+ Output a string containing colour-coded shell nesting level, current directory and git working tree status (used in the shell prompt).
166
+
167
+ ## git ca
168
+
169
+ Improved version of 'git commit --amend'. Updates files that are already in the commit and, optionally, adds and commits additional files.
170
+
171
+ ## git cleanup
172
+
173
+ List or delete branches that have already been merged and delete tracking branches that are no longer on ther remote.
174
+
175
+ ## git co
176
+
177
+ ## git mr
178
+
179
+ ## git parent
180
+
181
+ ## git update
182
+
183
+ Update the repo from the remote, rebase branches against their parents, optionally run git cleanup
184
+
185
+ ## git wt
186
+
187
+ Output the top level directory of the git working tree or return an error if we are not in a git working tree.
188
+
189
+ ## git review
190
+
191
+ ## venv-create
192
+
193
+ Create a script to create/update a virtual environment and run a python script in it.
@@ -1,46 +1,38 @@
1
1
  skilleter_thingy/__init__.py,sha256=rVPTxm8L5w52U0YdTd7r_D44SBP7pS3JCJtsf0iIsow,110
2
2
  skilleter_thingy/addpath.py,sha256=4Yhhgjjz1XDI98j0dAiQpNA2ejLefeWUTeSg3nIXQq0,3842
3
- skilleter_thingy/borger.py,sha256=voCEgxl-LdDMpCmBxSv3x0XnO9goalO0_T98pM1dqn8,7941
4
3
  skilleter_thingy/console_colours.py,sha256=BOS9mo3jChx_FE8L1j488MDoVNgib11KjTRhrz_YRYE,1781
5
- skilleter_thingy/diskspacecheck.py,sha256=7xsj4egXXV6jPhXZTe2b5rS03XAmm5uLC5TeiO1NJoE,2072
6
4
  skilleter_thingy/docker_purge.py,sha256=PRQ7EBXymjYIHuJL4pk4r6KNn09IF28OGZ0ln57xtNg,3314
7
5
  skilleter_thingy/ffind.py,sha256=rEgotUaMj9JxDCwz-7H5vdqxH_bXllaHqttwsOUGKj8,19235
8
- skilleter_thingy/ggit.py,sha256=rUa7rGxdw5ZcBN2u2tJw_beTI6tg0wBNsdPIyVajd6A,2488
9
- skilleter_thingy/ggrep.py,sha256=GMBWmRnAxqjFri3F_X6LqX04Q0VuwDB5nzO8D_tsrfw,5910
10
- skilleter_thingy/git_br.py,sha256=97wtkPx9sgBGR34Z62I2qYCg9iz_Fz-ndvOe3TqjC20,6027
11
- skilleter_thingy/git_ca.py,sha256=6nC5MxkBVC1fr2SHEc1XH0BO3vUWHaxV5gjCVBgPoWY,5191
12
- skilleter_thingy/git_cleanup.py,sha256=O8t6HiIjMmG4oz4LsvYdHaq1xsgCjICTWAcec-wBdTM,10564
13
- skilleter_thingy/git_co.py,sha256=QYPHRC1sb-tLsgWyBSp1oRj2-wSsJMSMY9A5wxcy_HQ,8432
14
- skilleter_thingy/git_common.py,sha256=W9vN03x3_0--8b5jUslpgglltQsLjzrEu7ik1x4LbFs,2134
15
- skilleter_thingy/git_hold.py,sha256=P2dny4ZA-c02OO3ALXEquMxWwa6mgDEZbDJJLnqloP8,4941
16
- skilleter_thingy/git_mr.py,sha256=IpzKhhtrPGle7P8x55WBlz3AGfo6XikMORbt9HPh8UU,3449
17
- skilleter_thingy/git_parent.py,sha256=xnA634w_4bzdBkl3ltYfrJJ69DH46FU1F4INJdBNNVc,2961
18
- skilleter_thingy/git_retag.py,sha256=V1OUkESsuDxZoWO4uELcfbysGrklIh0JWF7yrWU7UcM,1790
19
- skilleter_thingy/git_review.py,sha256=F2R-DS3IpQX7wUQpS0G19mdy4gOX1lXa2A9-R-Yn1ck,52599
20
- skilleter_thingy/git_update.py,sha256=W4e5mqzgLPwcb0Hh5CT5oZYO6KiCTcaf8_tiqVezC_g,14371
21
- skilleter_thingy/git_wt.py,sha256=bOfVEgYFZ6emdYHcfBnptm-XhqE6LVQT3jUW0O4ldXs,2325
6
+ skilleter_thingy/ggit.py,sha256=BL-DhNcz4Nd3sA-3Kl6gZ-zFtbNqOpyufvas-0aD8nk,2465
7
+ skilleter_thingy/ggrep.py,sha256=fnTzOI1Qbf7IY_TnStdx5uqeUhqSDkapxmhYgrONJHw,5887
8
+ skilleter_thingy/git_br.py,sha256=ZEYACvgH8QgPmCzTWLwAkJ1JBNwIQmG1phv8g9FNnSc,5796
9
+ skilleter_thingy/git_ca.py,sha256=ajPpmVsOsvBfMnf2P_8irUAa5N4a3cFQgLjN-by5LSg,4932
10
+ skilleter_thingy/git_cleanup.py,sha256=8PAxf3ZeKYYAuiBZNHQrKd_PlYYs9_-OwrIWFCC8_xg,10201
11
+ skilleter_thingy/git_co.py,sha256=0i8bOHJIA4zhyy_KWVWh8HbbEuQCKUAxASGZOdr_SYY,8205
12
+ skilleter_thingy/git_common.py,sha256=KCM5HcPEvOonClKfkY9vRcBFbHicRh7L17ysrGrQ5CI,1874
13
+ skilleter_thingy/git_hold.py,sha256=EkIHzubG7BsR-Vv-UCj8rl-9Hx7ft31t7IEf1nGW6WE,4616
14
+ skilleter_thingy/git_mr.py,sha256=g33FaRtJTbIQI0tfXv_a042YpGwtbg5fKw072aqjAdw,3086
15
+ skilleter_thingy/git_parent.py,sha256=s0HYTuVlEHLQCI9ZQ6EcR_9rSU9Ps3U2oSUABLX-YQI,2800
16
+ skilleter_thingy/git_retag.py,sha256=_e-oODX4mMV5o3OXSBlSYeqCCx-S4EWHEmu6Az8ABgY,1450
17
+ skilleter_thingy/git_retag.sync-conflict-20250928-192600-TVSLRWK.py,sha256=70rbybb1M2sCUblmD2-iLVG0xdFq-Bl5HG0U1LRnAvs,1442
18
+ skilleter_thingy/git_review.py,sha256=Z_e0wyQJ2AzOSy5cPI3jmAWystpJbHH4ygENjFagepo,52576
19
+ skilleter_thingy/git_update.py,sha256=Z3p3E33ZJ2DVa107UzaFR9V8LXADRuHjJL8TX3IhEa4,14348
20
+ skilleter_thingy/git_wt.py,sha256=93mbh8AKej8_y3aL6mVxKjKLEqMczaDtHoYcWf70eU0,2231
22
21
  skilleter_thingy/gitcmp_helper.py,sha256=NgQ0BZfa4TVA-XV6YKvrm5147boWUpGw-jDPUsktiMg,11346
23
- skilleter_thingy/gitprompt.py,sha256=UNmhmvB_O-WstrVUmdV_kB8afsG3nwqX-VTuup5ADpg,8935
22
+ skilleter_thingy/gitprompt.py,sha256=SzSMd0EGI7ftPko80Q2PipwbVA-qjU1jsmdpmTCM5GI,8912
24
23
  skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
25
24
  skilleter_thingy/linecount.py,sha256=ehTN6VD76i4U5k6dXuYoiqSRHI67_BP-bziklNAJSKY,4309
26
- skilleter_thingy/localphotosync.py,sha256=mK3rRewRBh4Fa3SAkFDudl5QLqvjrrozJnIMHNrj4nw,6382
27
- skilleter_thingy/moviemover.py,sha256=QzUAWQzQ1AWWREIhl-VMaLo2h8MMhOekBnao5jGWV1s,4470
28
25
  skilleter_thingy/multigit.py,sha256=rnQ0YGkEy6H54PRt8nCt-G02LGy-wiKRJVk8ovR_pTw,35179
29
- skilleter_thingy/photodupe.py,sha256=2hw4EhDKH37_BgdXKkPm9GrftfIORmubQi38Yn0b4Mg,4084
30
- skilleter_thingy/phototidier.py,sha256=BOu-cKHMivDlBqlRqv7sL3J6Ix1K2dxWWNcderldyZo,7818
31
26
  skilleter_thingy/py_audit.py,sha256=4CAdqBAIIVcpTCn_7dGm56bdfGpUtUJofqTGZomClkY,4417
32
27
  skilleter_thingy/readable.py,sha256=LcMMOiuzf9j5TsxcMbO0sbj6m1QCuABl91Hrv-YyIww,15422
33
28
  skilleter_thingy/remdir.py,sha256=Ueg3a6_m7y50zWykhKk6pcuz4FKPjoLJVPo9gh_dsic,4653
34
29
  skilleter_thingy/rmdupe.py,sha256=RWtOHq__zY4yOf6_Y-H-8RRJy31Sr3c8DEyTd6Y4oV4,17213
35
30
  skilleter_thingy/rpylint.py,sha256=TzZ5GvWrqgTKYKZwadTvzdbX-DJ8ll4WfVJqtN6IzO0,2635
36
- skilleter_thingy/splitpics.py,sha256=qRlJrqet7TEI6SodS4bkuKXQUpOdMaqmjE4c1CR7ouo,3266
37
31
  skilleter_thingy/strreplace.py,sha256=zMhqC38KF0BddTsRM5Pa99HU3KXvxXg942qxRK-LALA,2539
38
- skilleter_thingy/sysmon.py,sha256=wKbr3paMr62yMw29KglRduMe5fpmaJM4QXUk7orEvLo,11350
39
32
  skilleter_thingy/tfm.py,sha256=xMsqcuNJ32PwKF5vO3SO6etlbJKbCLUJhSdC2w0clwE,33829
40
33
  skilleter_thingy/tfparse.py,sha256=u1IZH2J_WH1aORyMozKSI2JKok7_S1MMJhiobzmhlUI,2988
41
34
  skilleter_thingy/trimpath.py,sha256=ctbV4iydncasuu41qRAmQbuCSUk72dxLUvbSRjEsHKk,2363
42
35
  skilleter_thingy/venv_create.py,sha256=EV_oZh3JlDc5hX5h9T1hnt65AEABw6PufaKvPYabR00,1159
43
- skilleter_thingy/window_rename.py,sha256=dCBgZqih_3YKHt35hsOAhARFp3QxOi8w8huC63sqJK8,3128
44
36
  skilleter_thingy/xchmod.py,sha256=T89xiH_po0nvH5T1AGgQOD5yhjKd9-LcHcmez3IORww,4604
45
37
  skilleter_thingy/yamlcheck.py,sha256=FXylZ5NtHirDlPVhVEUZUZkTugVR-g51BbjaN06akAc,2868
46
38
  skilleter_thingy/thingy/__init__.py,sha256=rVPTxm8L5w52U0YdTd7r_D44SBP7pS3JCJtsf0iIsow,110
@@ -51,8 +43,8 @@ skilleter_thingy/thingy/dc_util.py,sha256=Df73imXhHx3HzcPHiRcHAoea0e3HURdLcrolUs
51
43
  skilleter_thingy/thingy/dircolors.py,sha256=aBcq9ci855GSOIjrZWm8kG0ksCodvUmc4FlIOEOyBcA,12292
52
44
  skilleter_thingy/thingy/docker.py,sha256=9EFatudoVPfB1UbDEtzdJDB3o6ToHiNHv8-oLsUeqiQ,2449
53
45
  skilleter_thingy/thingy/files.py,sha256=oW6E6WWwVFSUPdrZnKMx7P_w_hh3etjoN7RrqvYHCHc,4705
54
- skilleter_thingy/thingy/git.py,sha256=NVW4qwkIkKqmTcxrWexon6rKdvvg3hxc3Hzkdrxrs0w,39701
55
- skilleter_thingy/thingy/git2.py,sha256=IQcUm60wFEaQqG0-3vxiD_QPALlKajZDU8VQp7aQdqk,39605
46
+ skilleter_thingy/thingy/git.py,sha256=d7pVv9M6k_xay3DU8-F1UxMWrN2xs1PWc7UOVvCM7Ys,39146
47
+ skilleter_thingy/thingy/git2.py,sha256=jIQqr0Ds2dz0zLCxBeasv_A6Ry1mGJYyEezJjAHWHXg,39028
56
48
  skilleter_thingy/thingy/gitlab.py,sha256=uXAF918xnPk6qQyiwPQDbMZfqtJzhiRqDS7yEtJEIAg,6079
57
49
  skilleter_thingy/thingy/path.py,sha256=8uM2Q9zFRWv_SaVOX49PeecQXttl7J6lsmBuRXWsXKY,4732
58
50
  skilleter_thingy/thingy/popup.py,sha256=hNfA9yh4jCv2su8XK33udcTWwgf98noBdYRRkFX1mxc,2517
@@ -61,9 +53,10 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
61
53
  skilleter_thingy/thingy/tfm_pane.py,sha256=XTTpSm71CyQyGmlVLuCthioOwech0jhUiFUXb-chS_Q,19792
62
54
  skilleter_thingy/thingy/tidy.py,sha256=AQ2RawsZJg6WHrgayi_ZptFL9occ7suSdCHbU3P-cys,5971
63
55
  skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
64
- skilleter_thingy-0.2.1.dist-info/licenses/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
65
- skilleter_thingy-0.2.1.dist-info/METADATA,sha256=mY5bR5E__LkA6RMyvyxgk8DlRwBtxnUTN06-gcJ8cwU,30429
66
- skilleter_thingy-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
67
- skilleter_thingy-0.2.1.dist-info/entry_points.txt,sha256=mklrWFvNKw9Hyem9RG3x0PoVYjlx2fDnJ3xWMTMOmfs,2258
68
- skilleter_thingy-0.2.1.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
69
- skilleter_thingy-0.2.1.dist-info/RECORD,,
56
+ skilleter_thingy-0.2.3.dist-info/licenses/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
57
+ skilleter_thingy-0.2.3.dist-info/METADATA,sha256=nHx-ihEZhMQJLSWOSoWPzebuTnNWMe-euOyqJ3R5x6g,28913
58
+ skilleter_thingy-0.2.3.dist-info/PKG-INFO 2,sha256=BryF-1KGwXobPiiN60EmDKuqAtIBSPadlgmJ72xZhMk,5313
59
+ skilleter_thingy-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
+ skilleter_thingy-0.2.3.dist-info/entry_points.txt,sha256=MTNWf8jOx8Fy3tSwVLCZPlEyzlDF36odw-IN-cSefP8,1784
61
+ skilleter_thingy-0.2.3.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
62
+ skilleter_thingy-0.2.3.dist-info/RECORD,,
@@ -1,8 +1,6 @@
1
1
  [console_scripts]
2
2
  addpath = skilleter_thingy:addpath.addpath
3
- borger = skilleter_thingy:borger.borger
4
3
  consolecolours = skilleter_thingy:console_colours.console_colours
5
- diskspacecheck = skilleter_thingy:diskspacecheck.diskspacecheck
6
4
  docker-purge = skilleter_thingy:docker_purge.docker_purge
7
5
  ffind = skilleter_thingy:ffind.ffind
8
6
  ggit = skilleter_thingy:ggit.ggit
@@ -24,26 +22,19 @@ gitprompt = skilleter_thingy:gitprompt.gitprompt
24
22
  gl = skilleter_thingy:gl.gl
25
23
  gphotosync = skilleter_thingy:gphotosync.gphotosync
26
24
  linecount = skilleter_thingy:linecount.linecount
27
- localphotosync = skilleter_thingy:localphotosync.localphotosync
28
25
  mg = skilleter_thingy:mg.mg
29
- moviemover = skilleter_thingy:moviemover.moviemover
30
26
  multigit = skilleter_thingy:multigit.multigit
31
- photodupe = skilleter_thingy:photodupe.photodupe
32
- phototidier = skilleter_thingy:phototidier.phototidier
33
27
  py-audit = skilleter_thingy:py_audit.py_audit
34
28
  readable = skilleter_thingy:readable.readable
35
29
  remdir = skilleter_thingy:remdir.remdir
36
30
  rmdupe = skilleter_thingy:rmdupe.rmdupe
37
31
  rpylint = skilleter_thingy:rpylint.rpylint
38
32
  s3-sync = skilleter_thingy:s3_sync.s3_sync
39
- splitpics = skilleter_thingy:splitpics.splitpics
40
33
  strreplace = skilleter_thingy:strreplace.strreplace
41
- sysmon = skilleter_thingy:sysmon.sysmon
42
34
  tfm = skilleter_thingy:tfm.tfm
43
35
  tfparse = skilleter_thingy:tfparse.tfparse
44
36
  trimpath = skilleter_thingy:trimpath.trimpath
45
37
  venv-create = skilleter_thingy:venv_create.venv_create
46
38
  webwatch = skilleter_thingy:webwatch.webwatch
47
- window-rename = skilleter_thingy:window_rename.window_rename
48
39
  xchmod = skilleter_thingy:xchmod.xchmod
49
40
  yamlcheck = skilleter_thingy:yamlcheck.yamlcheck
@@ -1,273 +0,0 @@
1
- #! /usr/bin/env python3
2
-
3
- """
4
- Wrapper for the borg backup command
5
-
6
- Copyright (C) 2018 John Skilleter
7
-
8
- TODO: Major tidy-up as this is a translation of a Bash script.
9
- TODO: Merge with the usb-backup script since both do almost the same job
10
- TODO: Default configuration file should be named for the hostname
11
- TODO: Move all configuration data into the configuration file
12
- """
13
-
14
- ################################################################################
15
- # Imports
16
-
17
- import sys
18
- import os
19
- import time
20
- import argparse
21
- import configparser
22
- import subprocess
23
- from pathlib import Path
24
-
25
- ################################################################################
26
- # Variables
27
-
28
- DEFAULT_CONFIG_FILE = Path('borger.ini')
29
-
30
- COMMANDS = ('backup', 'mount', 'umount', 'compact', 'info', 'prune', 'check', 'init')
31
-
32
- # TODO: NOT USED
33
- PRUNE_OPTIONS = [
34
- '--keep-within', '7d',
35
- '--keep-daily', '30',
36
- '--keep-weekly', '26',
37
- '--keep-monthly', '24',
38
- '--keep-yearly', '10',
39
- ]
40
-
41
- ################################################################################
42
-
43
- def run(args, cmd):
44
- """Run a subprocess."""
45
-
46
- if args.debug:
47
- cmd_str = ' '.join(cmd)
48
- print(f'Running "{cmd_str}"')
49
-
50
- try:
51
- return subprocess.run(cmd, check=True)
52
- except FileNotFoundError:
53
- print('Borg backup is not installed')
54
- sys.exit(1)
55
-
56
- ################################################################################
57
-
58
- def borg_backup(args, exclude_list):
59
- """Perform a backup."""
60
-
61
- create_options = ['--compression', 'auto,lzma']
62
-
63
- version = time.strftime('%Y-%m-%d-%H:%M:%S')
64
-
65
- print(f'Creating backup version {version}')
66
-
67
- if args.verbose:
68
- create_options += ['--list', '--filter=AMC']
69
-
70
- if args.dryrun:
71
- create_options.append('--dry-run')
72
- else:
73
- create_options.append('--stats')
74
-
75
- exclude_opts = []
76
-
77
- if exclude_list:
78
- for exclude in exclude_list:
79
- exclude_opts += ['--exclude', exclude]
80
-
81
- os.chdir(args.source)
82
-
83
- run(args,
84
- ['borg'] + args.options + ['create', f'{str(args.destination)}::{version}', str(args.source)] + create_options +
85
- ['--show-rc', '--one-file-system', '--exclude-caches'] + exclude_opts)
86
-
87
- ################################################################################
88
-
89
- def borg_prune(args):
90
- """Prune the repo by limiting the number of backups stored."""
91
-
92
- print('Pruning old backups')
93
-
94
- # Keep all backups for at least 7 days, 1 per day for 30 days, 1 per week for 2 years
95
- # 1 per month for 4 years and 1 per year for 10 years.
96
-
97
- run(args, ['borg'] + args.options + ['prune', str(args.destination)] + PRUNE_OPTIONS)
98
-
99
- ################################################################################
100
-
101
- def borg_compact(args):
102
- """Compact the repo."""
103
-
104
- print('Compacting the backup')
105
-
106
- # Keep all backups for at least 7 days, 1 per day for 30 days, 1 per week for 2 years
107
- # 1 per month for 4 years and 1 per year for 10 years.
108
-
109
- run(args, ['borg'] + args.options + ['compact', str(args.destination)])
110
-
111
- ################################################################################
112
-
113
- def borg_info(args):
114
- """Info."""
115
-
116
- run(args, ['borg'] + args.options + ['info', str(args.destination)])
117
-
118
- ################################################################################
119
-
120
- def borg_mount(args):
121
- """Mount."""
122
-
123
- print(f'Mounting Borg backups at {args.mount_dir}')
124
-
125
- mount = Path(args.mount_dir)
126
-
127
- if not mount.is_dir():
128
- mount.mkdir()
129
-
130
- run(args, ['borg'] + args.options + ['mount', str(args.destination), str(mount)])
131
-
132
- ################################################################################
133
-
134
- def borg_umount(args):
135
- """Unmount."""
136
-
137
- print('Unmounting {args.mount}')
138
-
139
- run(args, ['borg'] + args.options + ['umount', str(args.mount)])
140
-
141
- ################################################################################
142
-
143
- def borg_check(args):
144
- """Check the status of a backup."""
145
-
146
- run(args, ['borg'] + args.options + ['check', str(args.destination)])
147
-
148
- ################################################################################
149
-
150
- def borg_init(args):
151
- """Initialise a backup."""
152
-
153
- run(args, ['borg'] + args.options + ['init', str(args.destination), '--encryption=none'])
154
-
155
- ################################################################################
156
-
157
- def process_excludes(exclude_data):
158
- """Process the include list from the configuration file."""
159
-
160
- return exclude_data.replace('%', str(Path.cwd())).split('\n')
161
-
162
- ################################################################################
163
-
164
- def main():
165
- """Entry point."""
166
-
167
- command_list = ', '.join(COMMANDS)
168
-
169
- parser = argparse.ArgumentParser(description='Wrapper app for Borg backup to make it easier to use')
170
- parser.add_argument('--dryrun', '--dry-run', '-D', action='store_true', help='Dry-run comands')
171
- parser.add_argument('--debug', '-d', action='store_true', help='Debug')
172
- parser.add_argument('--verbose', '-v', action='store_true', help='Verbosity to the maximum')
173
- parser.add_argument('--config', '-c', default=None, help='Specify the configuration file')
174
- parser.add_argument('commands', nargs='+', help=f'One or more commands ({command_list})')
175
- args = parser.parse_args()
176
-
177
- # If no config file specified then look in all the usual places
178
-
179
- if args.config:
180
- args.config = Path(args.config)
181
- elif DEFAULT_CONFIG_FILE.is_file():
182
- args.config = DEFAULT_CONFIG_FILE
183
- else:
184
- args.config = Path.home() / DEFAULT_CONFIG_FILE
185
-
186
- if not args.config.is_file():
187
- args.config = Path(sys.argv[0]).parent / DEFAULT_CONFIG_FILE
188
-
189
- # Check that the configuration file exists
190
-
191
- if not args.config.is_file():
192
- print(f'Configuration file "{args.config}" not found')
193
- sys.exit(1)
194
-
195
- # Default options
196
-
197
- args.options = []
198
-
199
- # Read the configuration file
200
-
201
- config = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
202
- config.read(args.config)
203
-
204
- if 'borger' not in config:
205
- print('Invalid configuration file "args.config"')
206
- sys.exit(1)
207
-
208
- exclude = process_excludes(config['borger']['exclude']) if 'exclude' in config['borger'] else []
209
-
210
- if 'prune' in config['borger']:
211
- # TODO: Stuff
212
- print('Parser for the prune option is not implemented yet')
213
- sys.exit(1)
214
-
215
- if 'destination' in config['borger']:
216
- args.destination = config['borger']['destination']
217
- else:
218
- print('Destination directory not specified')
219
- sys.exit(1)
220
-
221
- if 'source' in config['borger']:
222
- args.source = Path(config['borger']['source'])
223
- else:
224
- print('Source directory not specified')
225
- sys.exit(1)
226
-
227
- # Initialise if necessary
228
-
229
- if args.debug:
230
- args.options.append('--verbose')
231
-
232
- if args.verbose:
233
- args.options.append('--progress')
234
-
235
- # Decide what to do
236
-
237
- for command in args.commands:
238
- if command == 'backup':
239
- borg_backup(args, exclude)
240
- elif command == 'mount':
241
- borg_mount(args)
242
- elif command == 'umount':
243
- borg_umount(args)
244
- elif command == 'info':
245
- borg_info(args)
246
- elif command == 'prune':
247
- borg_prune(args)
248
- elif command == 'check':
249
- borg_check(args)
250
- elif command == 'init':
251
- borg_init(args)
252
- elif command == 'compact':
253
- borg_compact(args)
254
- else:
255
- print(f'Unrecognized command: {command}')
256
- sys.exit(2)
257
-
258
- ################################################################################
259
-
260
- def borger():
261
- """Entry point"""
262
-
263
- try:
264
- main()
265
- except KeyboardInterrupt:
266
- sys.exit(1)
267
- except BrokenPipeError:
268
- sys.exit(2)
269
-
270
- ################################################################################
271
-
272
- if __name__ == '__main__':
273
- borger()