Django

Code

Show
Ignore:
Timestamp:
07/20/07 15:49:49 (1 year ago)
Author:
danderson
Message:

schema-evolution: merged trunk:HEAD into schema-evolution branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/schema-evolution/setup.py

    r3937 r5734  
    22from distutils.command.install import INSTALL_SCHEMES 
    33import os 
     4import sys 
     5 
     6def 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) 
    419 
    520# Tell distutils to put the data_files in platform-specific installation 
     
    1227# an easy way to do this. 
    1328packages, data_files = [], [] 
    14 root_dir = os.path.join(os.path.dirname(__file__), 'django') 
    15 for dirpath, dirnames, filenames in os.walk(root_dir): 
     29root_dir = os.path.dirname(__file__) 
     30django_dir = os.path.join(root_dir, 'django') 
     31pieces = fullsplit(root_dir) 
     32if pieces[-1] == '': 
     33    len_root_dir = len(pieces) - 1 
     34else: 
     35    len_root_dir = len(pieces) 
     36 
     37for dirpath, dirnames, filenames in os.walk(django_dir): 
    1638    # Ignore dirnames that start with '.' 
    1739    for i, dirname in enumerate(dirnames): 
    1840        if dirname.startswith('.'): del dirnames[i] 
    1941    if '__init__.py' in filenames: 
    20         packages.append(dirpath.replace('/', '.')) 
    21     else: 
    22         data_files.append((dirpath, [os.path.join(dirpath, f) for f in filenames])) 
     42        packages.append('.'.join(fullsplit(dirpath)[len_root_dir:])) 
     43    elif filenames: 
     44        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) 
     45 
     46# Dynamically calculate the version based on django.VERSION. 
     47version_tuple = __import__('django').VERSION 
     48if version_tuple[2] is not None: 
     49    version = "%d.%d_%s" % version_tuple 
     50else: 
     51    version = "%d.%d" % version_tuple[:2] 
    2352 
    2453setup( 
    2554    name = "Django", 
    26     version = "0.95"
     55    version = version
    2756    url = 'http://www.djangoproject.com/', 
    2857    author = 'Lawrence Journal-World',