source: src/django_gheat/external/django-extensions/setup.py@ 9006

Last change on this file since 9006 was 9006, checked in by dennisw, 14 years ago

django_gheat - versie van gheat die gebruik maakt van django framework, ondersteunt SQL connecties in tegenstelling tot gheat dat gebruik maakt van sqlite

File size: 2.6 KB
Line 
1"""
2Based entirely on Django's own ``setup.py``.
3"""
4import os
5from distutils.command.install import INSTALL_SCHEMES
6from distutils.core import setup
7
8def fullsplit(path, result=None):
9 """
10 Split a pathname into components (the opposite of os.path.join) in a
11 platform-neutral way.
12 """
13 if result is None:
14 result = []
15 head, tail = os.path.split(path)
16 if head == '':
17 return [tail] + result
18 if head == path:
19 return result
20 return fullsplit(head, [tail] + result)
21
22# Tell distutils to put the data_files in platform-specific installation
23# locations. See here for an explanation:
24# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
25for scheme in INSTALL_SCHEMES.values():
26 scheme['data'] = scheme['purelib']
27
28# Compile the list of packages available, because distutils doesn't have
29# an easy way to do this.
30packages, data_files = [], []
31root_dir = os.path.dirname(__file__)
32extensions_dir = os.path.join(root_dir, 'django_extensions')
33pieces = fullsplit(root_dir)
34if pieces[-1] == '':
35 len_root_dir = len(pieces) - 1
36else:
37 len_root_dir = len(pieces)
38
39for dirpath, dirnames, filenames in os.walk(extensions_dir):
40 # Ignore dirnames that start with '.'
41 for i, dirname in enumerate(dirnames):
42 if dirname.startswith('.'):
43 del dirnames[i]
44 #if 'conf' in dirpath:
45 # print dirpath
46 if '__init__.py' in filenames and not 'conf' in dirpath:
47 packages.append('.'.join(fullsplit(dirpath)[len_root_dir:]))
48 elif filenames:
49 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
50
51version = __import__('django_extensions').__version__
52
53setup(
54 name = 'django-extensions',
55 version = version,
56 description = "Extensions for Django",
57 long_description = """django-extensions bundles several useful
58additions for Django projects. See the project page for more information:
59 http://code.google.com/p/django-command-extensions/""",
60 author = 'Michael Trier',
61 author_email = 'mtrier@gmail.com',
62 url = 'http://code.google.com/p/django-command-extensions/',
63 license = 'New BSD License',
64 platforms = ['any'],
65 packages = packages,
66 data_files = data_files,
67 classifiers = ['Development Status :: 4 - Beta',
68 'Environment :: Web Environment',
69 'Framework :: Django',
70 'Intended Audience :: Developers',
71 'License :: OSI Approved :: BSD License',
72 'Operating System :: OS Independent',
73 'Programming Language :: Python',
74 'Topic :: Utilities'],
75)
76
Note: See TracBrowser for help on using the repository browser.