Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (32 sloc) 0.964 kb
a179c03 Brian Rosner Added a setup.py.
brosner authored
1 import os
2
3 from distutils.core import setup
4
5
6 def fullsplit(path, result=None):
7 """
8 Split a pathname into components (the opposite of os.path.join) in a
9 platform-neutral way.
10 """
11 if result is None:
12 result = []
13 head, tail = os.path.split(path)
14 if head == '':
15 return [tail] + result
16 if head == path:
17 return result
18 return fullsplit(head, [tail] + result)
19
20
21 data_files, packages = [], []
22 djng_dir = "djng"
23
24 for dirpath, dirnames, filenames in os.walk(djng_dir):
25 # Ignore dirnames that start with "."
26 for i, dirname in enumerate(dirnames):
27 if dirname.startswith("."):
28 del dirnames[i]
29 if "__init__.py" in filenames:
30 packages.append(".".join(fullsplit(dirpath)))
31 elif filenames:
32 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
33
34 setup(
35 name = "djng",
36 version = "0.1",
37 packages = packages,
38 data_files = data_files,
39 )
Something went wrong with that request. Please try again.