Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Croft
committed
Sep 20, 2011
1 parent
c76a072
commit a0217b5
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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) |