Permalink
Browse files

Adding setup.py.

  • Loading branch information...
1 parent c76a072 commit a0217b5fff519317fe87d80e1e1e2bd44e64620c @jcroft committed Sep 20, 2011
Showing with 38 additions and 0 deletions.
  1. +38 −0 setup.py
View
@@ -0,0 +1,38 @@
+import os
+from distutils.core import setup
+
+
+def fullsplit(path, result=None):
+ """
+ Split a pathname into components (the opposite of os.path.join) in a
+ platform-neutral way.
+ """
+ if result is None:
+ result = []
+ head, tail = os.path.split(path)
+ if head == "":
+ return [tail] + result
+ if head == path:
+ return result
+ return fullsplit(head, [tail] + result)
+
+
+package_dir = "rating"
+
+
+packages = []
+for dirpath, dirnames, filenames in os.walk(package_dir):
+ # ignore dirnames that start with '.'
+ for i, dirname in enumerate(dirnames):
+ if dirname.startswith("."):
+ del dirnames[i]
+ if "__init__.py" in filenames:
+ packages.append(".".join(fullsplit(dirpath)))
+
+
+setup(name='rating',
+ version='0.1',
+ description='Provides five star rating functionality for Django',
+ author='Jeff Croft',
+ url='http://github.com/jcroft/django-rating',
+ packages=packages)

0 comments on commit a0217b5

Please sign in to comment.