[PhotoFloat] [PATCH] use distutils to install python package in proper locations

anarcat at orangeseeds.org anarcat at orangeseeds.org
Mon Jun 24 03:48:43 CEST 2013


From: Antoine Beaupré <anarcat at koumbit.org>

---
 photofloat          |   21 +++++++++++++++++++++
 scanner/__init__.py |   23 +++++++++++++++++++++++
 scanner/main.py     |   21 ---------------------
 setup.py            |   11 +++++++++++
 4 files changed, 55 insertions(+), 21 deletions(-)
 create mode 100755 photofloat
 create mode 100644 scanner/__init__.py
 delete mode 100755 scanner/main.py
 create mode 100755 setup.py

diff --git a/photofloat b/photofloat
new file mode 100755
index 0000000..8bce07b
--- /dev/null
+++ b/photofloat
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+from scanner.TreeWalker import TreeWalker
+from scanner.CachePath import message
+import sys
+
+def main():
+	reload(sys)
+	sys.setdefaultencoding("UTF-8")
+
+	if len(sys.argv) != 3:
+		print "usage: %s ALBUM_PATH CACHE_PATH" % sys.argv[0]
+		return
+	try:
+		TreeWalker(sys.argv[1], sys.argv[2])
+	except KeyboardInterrupt:
+		message("keyboard", "CTRL+C pressed, quitting.")
+		sys.exit(-97)
+	
+if __name__ == "__main__":
+	main()
diff --git a/scanner/__init__.py b/scanner/__init__.py
new file mode 100644
index 0000000..bcd87eb
--- /dev/null
+++ b/scanner/__init__.py
@@ -0,0 +1,23 @@
+__version_info__ = ('1', '0')
+__version__ = '.'.join(__version_info__)
+__copyright__ = """Copyright (C) 2011-2012
+This program comes with ABSOLUTELY NO WARRANTY.
+This is free software, and you are welcome to redistribute it
+under certain conditions.
+For details see the COPYRIGHT file distributed along this program."""
+
+__license__ = """
+    This package is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    any later version.
+
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+"""
diff --git a/scanner/main.py b/scanner/main.py
deleted file mode 100755
index c1fbf8c..0000000
--- a/scanner/main.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-
-from TreeWalker import TreeWalker
-from CachePath import message
-import sys
-
-def main():
-	reload(sys)
-	sys.setdefaultencoding("UTF-8")
-
-	if len(sys.argv) != 3:
-		print "usage: %s ALBUM_PATH CACHE_PATH" % sys.argv[0]
-		return
-	try:
-		TreeWalker(sys.argv[1], sys.argv[2])
-	except KeyboardInterrupt:
-		message("keyboard", "CTRL+C pressed, quitting.")
-		sys.exit(-97)
-	
-if __name__ == "__main__":
-	main()
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..0861ff9
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,11 @@
+#! /usr/bin/python
+
+from distutils.core import setup
+
+import scanner
+
+setup(name='photofloat',
+      version=scanner.__version__,
+      packages=['scanner'],
+      scripts=['photofloat'],
+      )
-- 
1.7.10.4



More information about the PhotoFloat mailing list