1 import os |
1 import os |
2 from setuptools import setup, find_packages |
2 from setuptools import setup, find_packages |
3 |
3 |
4 ROOT_DIR = os.path.dirname(__file__) |
4 ROOT_DIR = os.path.dirname(__file__) |
5 SOURCE_DIR = os.path.join(ROOT_DIR) |
5 SOURCE_DIR = os.path.join(ROOT_DIR, 'ldt') |
6 |
6 |
7 version = __import__('ldt').__version__ |
7 version = __import__('ldt').__version__ |
8 |
8 |
|
9 def fullsplit(path, result=None): |
|
10 """ |
|
11 Split a pathname into components (the opposite of os.path.join) in a |
|
12 platform-neutral way. |
|
13 """ |
|
14 if result is None: |
|
15 result = [] |
|
16 head, tail = os.path.split(path) |
|
17 if head == '': |
|
18 return [tail] + result |
|
19 if head == path: |
|
20 return result |
|
21 return fullsplit(head, [tail] + result) |
|
22 |
9 packages, data_files = [], [] |
23 packages, data_files = [], [] |
10 |
24 |
11 for dirpath, dirnames, filenames in os.walk(django_dir): |
25 for dirpath, dirnames, filenames in os.walk(SOURCE_DIR): |
12 # Ignore dirnames that start with '.' |
26 # Ignore dirnames that start with '.' |
13 for i, dirname in enumerate(dirnames): |
27 for i, dirname in enumerate(dirnames): |
14 if dirname.startswith('.'): del dirnames[i] |
28 if dirname.startswith('.'): del dirnames[i] |
15 if '__init__.py' in filenames: |
29 if '__init__.py' in filenames: |
16 packages.append('.'.join(fullsplit(dirpath))) |
30 packages.append('.'.join(fullsplit(dirpath))) |