From d27eebf8147fafbdcd93820388944a70a65f01d6 Mon Sep 17 00:00:00 2001 From: Karl Voit Date: Sat, 3 Feb 2018 19:35:41 +0100 Subject: [PATCH] refactored project structure to meet pip conventions --- .gitignore | 1 + LICENSE => LICENSE.txt | 0 README.org | 39 +++++++++++++++---- guessfilename.py => guessfilename/__init__.py | 4 +- .../guessfilenameconfig-TEMPLATE.py | 0 5 files changed, 34 insertions(+), 10 deletions(-) rename LICENSE => LICENSE.txt (100%) rename guessfilename.py => guessfilename/__init__.py (99%) rename guessfilenameconfig-TEMPLATE.py => guessfilename/guessfilenameconfig-TEMPLATE.py (100%) diff --git a/.gitignore b/.gitignore index 4306da8..054ce69 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ testdata MANIFEST dist dist/ .gitignore +update_pip.sh diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README.org b/README.org index dd5585d..c4ad2e9 100644 --- a/README.org +++ b/README.org @@ -1,7 +1,3 @@ -## Time-stamp: <2016-03-06 19:41:02 vk> -## -*- coding: utf-8 -*- -## This file is best viewed with GNU Emacs Org-mode: http://orgmode.org/ - * guessfilename.py This Python script tries to come up with a new file name for each @@ -37,12 +33,39 @@ customer numbers or phone numbers, amounts to pay, and so on. ** Usage -: guessfilename.py a_file_name.txt -... FIXXME +#+BEGIN_SRC sh :results output :wrap src +./guessfilename/__init__.py --help +#+END_SRC + +#+BEGIN_src +Usage: + guessfilename [] + +This little Python script tries to rename files according to pre-defined rules. + +It does this with several methods: first, the current file name is analyzed and +any ISO date/timestamp and filetags are re-used. Secondly, if the parsing of the +file name did not lead to any new file name, the content of the file is analyzed. + +You have to adapt the rules in the Python script to meet your requirements. +The default rule-set follows the filename convention described on +http://karl-voit.at/managing-digital-photographs/ -For a complete list of parameters, please try: -: guessfilename.py --help +:copyright: (c) by Karl Voit +:license: GPL v3 or any later version +:URL: https://github.com/novoid/guess-filename.py +:bugreports: via github or + + +Options: + -h, --help show this help message and exit + -d, --dryrun enable dryrun mode: just simulate what would happen, do not + modify files + -v, --verbose enable verbose mode + -q, --quiet enable quiet mode + --version display version and exit +#+END_src * Related tools and workflows diff --git a/guessfilename.py b/guessfilename/__init__.py similarity index 99% rename from guessfilename.py rename to guessfilename/__init__.py index 815a513..2e5f1d6 100755 --- a/guessfilename.py +++ b/guessfilename/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -PROG_VERSION = u"Time-stamp: <2017-12-24 16:40:35 vk>" +PROG_VERSION = u"Time-stamp: <2018-02-03 19:32:22 vk>" # TODO: @@ -38,7 +38,7 @@ PROG_VERSION_DATE = PROG_VERSION[13:23] INVOCATION_TIME = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime()) USAGE = "\n\ - " + sys.argv[0] + " [] \n\ + guessfilename [] \n\ \n\ This little Python script tries to rename files according to pre-defined rules.\n\ \n\ diff --git a/guessfilenameconfig-TEMPLATE.py b/guessfilename/guessfilenameconfig-TEMPLATE.py similarity index 100% rename from guessfilenameconfig-TEMPLATE.py rename to guessfilename/guessfilenameconfig-TEMPLATE.py