skilleter-thingy 0.0.43__tar.gz → 0.0.45__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.
- {skilleter_thingy-0.0.43/skilleter_thingy.egg-info → skilleter_thingy-0.0.45}/PKG-INFO +1 -1
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/pyproject.toml +1 -1
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_wt.py +17 -10
- skilleter_thingy-0.0.45/skilleter_thingy/thingy/bash_venv.py +47 -0
- skilleter_thingy-0.0.45/skilleter_thingy/thingy/fish_venv.py +41 -0
- skilleter_thingy-0.0.45/skilleter_thingy/venv_create.py +55 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45/skilleter_thingy.egg-info}/PKG-INFO +1 -1
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/SOURCES.txt +3 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/LICENSE +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/README.md +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/setup.cfg +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/__init__.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/addpath.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/borger.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/console_colours.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/diskspacecheck.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/docker_purge.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/ffind.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/ggit.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/ggrep.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_br.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_ca.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_cleanup.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_co.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_common.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_hold.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_mr.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_parent.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_review.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/git_update.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/gitcmp_helper.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/gitprompt.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/gl.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/gphotosync.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/linecount.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/moviemover.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/photodupe.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/phototidier.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/py_audit.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/readable.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/remdir.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/rmdupe.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/rpylint.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/splitpics.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/strreplace.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/sysmon.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/tfm.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/tfparse.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/__init__.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/colour.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/dc_curses.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/dc_defaults.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/dc_util.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/dircolors.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/docker.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/files.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/git.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/git2.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/gitlab.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/logger.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/path.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/popup.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/process.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/run.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/tfm_pane.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/thingy/tidy.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/trimpath.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/window_rename.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/xchmod.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy/yamlcheck.py +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/dependency_links.txt +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/entry_points.txt +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/requires.txt +0 -0
- {skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.45
|
|
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
|
|
@@ -14,7 +14,7 @@ import sys
|
|
|
14
14
|
import argparse
|
|
15
15
|
import os
|
|
16
16
|
|
|
17
|
-
import
|
|
17
|
+
import pygit2
|
|
18
18
|
|
|
19
19
|
################################################################################
|
|
20
20
|
|
|
@@ -24,21 +24,28 @@ def main():
|
|
|
24
24
|
# Command line parameters
|
|
25
25
|
|
|
26
26
|
parser = argparse.ArgumentParser(description='Report top-level directory of the current git working tree.')
|
|
27
|
-
parser.add_argument('
|
|
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('
|
|
29
|
+
parser.add_argument('--repo', '-r', action='store_true',
|
|
30
30
|
help='If we are already at the top of the working tree, look for a parent directory with a repo control file (.repo directory or .mrconfig file) and output that directory.')
|
|
31
|
+
parser.add_argument('--dir', '-d', action='store', default=os.getcwd(),
|
|
32
|
+
help='Find the location of the top-level directory in the working tree starting at the specified directory')
|
|
31
33
|
parser.add_argument('level', nargs='?', type=int, default=0, help='Number of levels below the top-level directory to report')
|
|
32
34
|
args = parser.parse_args()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
print('Unable to locate current directory')
|
|
35
|
+
|
|
36
|
+
if not os.path.isdir(args.dir):
|
|
37
|
+
print(f'Unable to locate directory {args.dir}')
|
|
37
38
|
sys.exit(1)
|
|
38
39
|
|
|
39
40
|
# Try to get the current working tree
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
git_dir = pygit2.discover_repository(args.dir)
|
|
43
|
+
|
|
44
|
+
if not git_dir:
|
|
45
|
+
print(f'Directory {args.dir} is not in a Git working tree')
|
|
46
|
+
sys.exit(2)
|
|
47
|
+
|
|
48
|
+
working_tree = os.path.abspath(os.path.join(git_dir, os.pardir))
|
|
42
49
|
|
|
43
50
|
# If we are in a working tree and also looking for the parent working
|
|
44
51
|
# tree, check if we are at the top of the current tree, and, if so,
|
|
@@ -50,7 +57,7 @@ def main():
|
|
|
50
57
|
if os.path.samefile(working_tree, current_directory):
|
|
51
58
|
os.chdir('..')
|
|
52
59
|
|
|
53
|
-
working_tree =
|
|
60
|
+
working_tree = pygit2.discover_repository()
|
|
54
61
|
|
|
55
62
|
# If we are also looking for a multi-repo control file or directory, and haven't
|
|
56
63
|
# found the git working tree root scan up the tree until we find one.
|
|
@@ -70,7 +77,7 @@ def main():
|
|
|
70
77
|
# Output the result, if we have one
|
|
71
78
|
|
|
72
79
|
if args.level:
|
|
73
|
-
start =
|
|
80
|
+
start = args.dir.split('/')
|
|
74
81
|
working = working_tree.split('/')
|
|
75
82
|
|
|
76
83
|
working_tree = os.path.join(working_tree, '/'.join(start[len(working):len(working) + int(args.level)]))
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
TEMPLATE = \
|
|
2
|
+
"""#!/usr/bin/env bash
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
################################################################################
|
|
7
|
+
|
|
8
|
+
VENV_NAME=$(basename "$0")
|
|
9
|
+
VENV_DIR=__venv__
|
|
10
|
+
|
|
11
|
+
GREEN="\e[42m"
|
|
12
|
+
NORMAL="\e[0m"
|
|
13
|
+
|
|
14
|
+
################################################################################
|
|
15
|
+
|
|
16
|
+
function box()
|
|
17
|
+
{
|
|
18
|
+
echo -e "${GREEN}################################################################################${NORMAL}"
|
|
19
|
+
echo -e "${GREEN}# $@${NORMAL}"
|
|
20
|
+
echo -e "${GREEN}################################################################################${NORMAL}"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
################################################################################
|
|
24
|
+
|
|
25
|
+
box "Creating & activating $VENV_NAME virtual environment"
|
|
26
|
+
|
|
27
|
+
python3 -m venv $VENV_DIR
|
|
28
|
+
|
|
29
|
+
source $VENV_DIR/bin/activate
|
|
30
|
+
|
|
31
|
+
if [[ -f requirements.txt ]]
|
|
32
|
+
then
|
|
33
|
+
box "Installing/Upgrading packages"
|
|
34
|
+
|
|
35
|
+
python3 -m pip install -r requirements.txt
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
if [[ -f ${VENV_NAME} ]]
|
|
39
|
+
then
|
|
40
|
+
box "Running ${VENV_NAME} script"
|
|
41
|
+
|
|
42
|
+
python3 ./${VENV_NAME}.py "$@"
|
|
43
|
+
|
|
44
|
+
deactivate
|
|
45
|
+
fi
|
|
46
|
+
"""
|
|
47
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
TEMPLATE = \
|
|
2
|
+
"""#!/usr/bin/env fish
|
|
3
|
+
|
|
4
|
+
################################################################################
|
|
5
|
+
|
|
6
|
+
set VENV_NAME $(basename "$0")
|
|
7
|
+
set VENV_DIR __venv__
|
|
8
|
+
|
|
9
|
+
set GREEN "\e[42m"
|
|
10
|
+
set NORMAL "\e[0m"
|
|
11
|
+
|
|
12
|
+
################################################################################
|
|
13
|
+
|
|
14
|
+
function box
|
|
15
|
+
echo -e "$GREEN################################################################################$NORMAL"
|
|
16
|
+
echo -e "$GREEN# $argv$NORMAL"
|
|
17
|
+
echo -e "$GREEN################################################################################$NORMAL"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
################################################################################
|
|
21
|
+
|
|
22
|
+
box "Creating & activating $VENV_NAME virtual environment"
|
|
23
|
+
|
|
24
|
+
python3 -m venv $VENV_DIR
|
|
25
|
+
|
|
26
|
+
source $VENV_DIR/bin/activate.fish
|
|
27
|
+
|
|
28
|
+
if test -f requirements.txt
|
|
29
|
+
box "Installing/Upgrading packages"
|
|
30
|
+
|
|
31
|
+
python3 -m pip install -r requirements.txt
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
if test -f $VENV_NAME.py
|
|
35
|
+
box "Running $VENV_NAME script"
|
|
36
|
+
|
|
37
|
+
python3 ./$VENV_NAME.py $argv
|
|
38
|
+
|
|
39
|
+
deactivate
|
|
40
|
+
end
|
|
41
|
+
"""
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import stat
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
import thingy.bash_venv as bash_venv
|
|
8
|
+
import thingy.fish_venv as fish_venv
|
|
9
|
+
|
|
10
|
+
################################################################################
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
"""Create the venv script and make it executable"""
|
|
14
|
+
|
|
15
|
+
parser = argparse.ArgumentParser(description='Create a script to run Python code in a virtual environment')
|
|
16
|
+
parser.add_argument('name', nargs=1, help='Name of the script to create')
|
|
17
|
+
|
|
18
|
+
args = parser.parse_args()
|
|
19
|
+
|
|
20
|
+
shell = os.getenv('SHELL').split('/')[-1]
|
|
21
|
+
|
|
22
|
+
if shell == 'fish':
|
|
23
|
+
template = fish_venv.TEMPLATE
|
|
24
|
+
else:
|
|
25
|
+
if shell != 'bash':
|
|
26
|
+
print(f'Warning: Unknown shell: {shell} - using Bash template by default')
|
|
27
|
+
|
|
28
|
+
template = bash_venv.TEMPLATE
|
|
29
|
+
|
|
30
|
+
with open(args.name[0], 'wt') as scriptfile:
|
|
31
|
+
scriptfile.write(template)
|
|
32
|
+
|
|
33
|
+
statinfo = os.stat(args.name[0])
|
|
34
|
+
|
|
35
|
+
os.chmod(args.name[0], statinfo.st_mode|stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH)
|
|
36
|
+
|
|
37
|
+
print(f'Created virtual environment: {args.name[0]}')
|
|
38
|
+
|
|
39
|
+
################################################################################
|
|
40
|
+
|
|
41
|
+
def venv_create():
|
|
42
|
+
"""Entry point"""
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
main()
|
|
46
|
+
|
|
47
|
+
except KeyboardInterrupt:
|
|
48
|
+
sys.exit(1)
|
|
49
|
+
except BrokenPipeError:
|
|
50
|
+
sys.exit(2)
|
|
51
|
+
|
|
52
|
+
################################################################################
|
|
53
|
+
|
|
54
|
+
if __name__ == '__main__':
|
|
55
|
+
venv_create()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.45
|
|
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
|
|
@@ -40,6 +40,7 @@ skilleter_thingy/sysmon.py
|
|
|
40
40
|
skilleter_thingy/tfm.py
|
|
41
41
|
skilleter_thingy/tfparse.py
|
|
42
42
|
skilleter_thingy/trimpath.py
|
|
43
|
+
skilleter_thingy/venv_create.py
|
|
43
44
|
skilleter_thingy/window_rename.py
|
|
44
45
|
skilleter_thingy/xchmod.py
|
|
45
46
|
skilleter_thingy/yamlcheck.py
|
|
@@ -50,6 +51,7 @@ skilleter_thingy.egg-info/entry_points.txt
|
|
|
50
51
|
skilleter_thingy.egg-info/requires.txt
|
|
51
52
|
skilleter_thingy.egg-info/top_level.txt
|
|
52
53
|
skilleter_thingy/thingy/__init__.py
|
|
54
|
+
skilleter_thingy/thingy/bash_venv.py
|
|
53
55
|
skilleter_thingy/thingy/colour.py
|
|
54
56
|
skilleter_thingy/thingy/dc_curses.py
|
|
55
57
|
skilleter_thingy/thingy/dc_defaults.py
|
|
@@ -57,6 +59,7 @@ skilleter_thingy/thingy/dc_util.py
|
|
|
57
59
|
skilleter_thingy/thingy/dircolors.py
|
|
58
60
|
skilleter_thingy/thingy/docker.py
|
|
59
61
|
skilleter_thingy/thingy/files.py
|
|
62
|
+
skilleter_thingy/thingy/fish_venv.py
|
|
60
63
|
skilleter_thingy/thingy/git.py
|
|
61
64
|
skilleter_thingy/thingy/git2.py
|
|
62
65
|
skilleter_thingy/thingy/gitlab.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{skilleter_thingy-0.0.43 → skilleter_thingy-0.0.45}/skilleter_thingy.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|