refactored project structure according to pip guidelines

This commit is contained in:
Karl Voit 2018-02-03 18:04:28 +01:00
parent f660317cc4
commit d0b2b7b630
3 changed files with 24 additions and 19 deletions

5
.gitignore vendored
View file

@ -3,3 +3,8 @@ dist
MANIFEST
setup.py
.gitignore
update_pip.sh
manualtests/
.gitignore
build/
appendfilename.egg-info/

View file

@ -51,20 +51,20 @@ GNU/Linux.
** Usage
: appendfilename.py --text foo a_file_name.txt
: appendfilename --text foo a_file_name.txt
... adds "foo" such that it results in ~a_file_name foo.txt~
: appendfilename.py a_file_name.txt
: appendfilename a_file_name.txt
... (implicit) interactive mode: asking for the string to add from the user
: appendfilename.py --text "foo bar" "file name 1.jpg" "file name 2 -- foo.txt" "file name 3 -- bar.csv"
: appendfilename --text "foo bar" "file name 1.jpg" "file name 2 -- foo.txt" "file name 3 -- bar.csv"
... adds tag "foo" such that it results in ...
: "file name 1 foo bar.jpg"
: "file name 2 foo bar -- foo.txt"
: "file name 3 foo bar -- bar.csv"
For a complete list of parameters, please try:
: appendfilename.py --help
: appendfilename --help
The file names within the current working directory is read in and all
found words can be completed via TAB.
@ -72,12 +72,12 @@ found words can be completed via TAB.
-----------------------
#+BEGIN_SRC sh :results output :wrap src
./appendfilename.py --help
./appendfilename/__init__.py --help
#+END_SRC
#+BEGIN_src
Usage:
./appendfilename.py [<options>] <list of files>
appendfilename.py [<options>] <list of files>
This tool inserts text between the old file name and optional tags or file extension.
@ -92,9 +92,9 @@ When renaming a symbolic link whose source file has a matching file
name, the source file gets renamed as well.
Example usages:
./appendfilename.py --text="of projectA" "the presentation.pptx"
appendfilename.py --text="of projectA" "the presentation.pptx"
... results in "the presentation of projectA.pptx"
./appendfilename.py "2013-05-09T16.17_img_00042 -- fun.jpeg"
appendfilename.py "2013-05-09T16.17_img_00042 -- fun.jpeg"
... with interactive input of "Peter" results in:
"2013-05-09T16.17_img_00042 Peter -- fun.jpeg"
@ -139,7 +139,7 @@ script does provide a shell window for entering the tags.
: --geometry=90x5+330+5 \
: --tab-with-profile=big \
: --hide-menubar \
: -x /home/vk/src/appendfilename/appendfilename.py "${@}"
: -x /home/vk/src/appendfilename/appendfilename/__init__.py "${@}"
:
: #end
@ -191,7 +191,7 @@ script does provide a shell window for entering the tags.
: --geometry=73x5+330+5 \
: --tab-with-profile=big \
: --hide-menubar \
: -x /home/vk/src/appendfilename/appendfilename.py --interactive "${@}"
: -x /home/vk/src/appendfilename/appendfilename/__init__.py --interactive "${@}"
:
: #end
@ -203,7 +203,7 @@ looks like:
: --geometry=73x5+330+5 \
: --tab-with-profile=big \
: --hide-menubar \
: -x /home/vk/src/appendfilename/appendfilename.py --interactive --remove "${@}"
: -x /home/vk/src/appendfilename/appendfilename/__init__.py --interactive --remove "${@}"
:
: #end
@ -283,7 +283,7 @@ If they don't match, following script re-writes ~accels.scm~ with the current ID
Create a registry file =add_appendfilename_to_context_menu.reg= and edit it
to meet the following template. Please make sure to replace the paths
(python, =USERNAME= and =appendfilename.py=) accordingly:
(python, =USERNAME= and =appendfilename=) accordingly:
#+BEGIN_EXAMPLE
Windows Registry Editor Version 5.00
@ -294,7 +294,7 @@ Windows Registry Editor Version 5.00
@="appendfilename (single file)"
[HKEY_CLASSES_ROOT\*\shell\appendfilename\command]
@="C:\\Python36\\python.exe C:\\Users\\USERNAME\\src\\appendfilename\\appendfilename.py -i \"%1\""
@="C:\\Python36\\python.exe C:\\Users\\USERNAME\\src\\appendfilename\\appendfilename\\__init__.py -i \"%1\""
#+END_EXAMPLE
Execute the reg-file, confirm the warnings (you are modifying your
@ -310,7 +310,7 @@ you will get three different filetag-windows to tag one file each.
Create a batch file in your home directory. Adapt the paths to meet
your setup. The content looks like:
: C:\Python36\python.exe C:\Users\USERNAME\src\appendfilename\appendfilename.py -i %*
: C:\Python36\python.exe C:\Users\USERNAME\src\appendfilename\appendfilename\__init__.py -i %*
If you want to confirm the process (and see error messages and so
forth), you might want to append as well following line:
@ -337,7 +337,7 @@ appendfilename as an favorite command:
- Name: appendfilename
- Program or folder: <Path to appendfilename.bar>
- =appendfilename.bat= looks like: (please do modify the paths to meet your requirement)
: C:\Python36\python.exe C:\Users\YOURUSERNAME\src\appendfilename\appendfilename %*
: C:\Python36\python.exe C:\Users\YOURUSERNAME\src\appendfilename\appendfilename\__init__.py %*
: REM optionally: set /p DUMMY=Hit ENTER to continue...
- Start folder: =%ActivDir%=
- Parameter: =%ActivSel%=

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
PROG_VERSION = u"Time-stamp: <2018-02-03 17:28:20 vk>"
PROG_VERSION = u"Time-stamp: <2018-02-03 18:00:59 vk>"
# TODO:
# * fix parts marked with «FIXXME»
@ -28,7 +28,7 @@ TEXT_SEPARATOR = ' ' # between old file name and inserted text
RENAME_SYMLINK_ORIGINALS_WHEN_RENAMING_SYMLINKS = True # if current file is a symlink with the same name, also rename source file
USAGE = "\n\
" + sys.argv[0] + " [<options>] <list of files>\n\
appendfilename [<options>] <list of files>\n\
\n\
This tool inserts text between the old file name and optional tags or file extension.\n\
\n\
@ -44,9 +44,9 @@ When renaming a symbolic link whose source file has a matching file\n\
name, the source file gets renamed as well.\n\
\n\
Example usages:\n\
" + sys.argv[0] + " --text=\"of projectA\" \"the presentation.pptx\"\n\
appendfilename --text=\"of projectA\" \"the presentation.pptx\"\n\
... results in \"the presentation" + TEXT_SEPARATOR + "of projectA.pptx\"\n\
" + sys.argv[0] + " \"2013-05-09T16.17_img_00042 -- fun.jpeg\"\n\
appendfilename \"2013-05-09T16.17_img_00042 -- fun.jpeg\"\n\
... with interactive input of \"Peter\" results in:\n\
\"2013-05-09T16.17_img_00042" + TEXT_SEPARATOR + "Peter -- fun.jpeg\"\n\
\n\