Changeset 8738 for mauRepo/dj_security


Ignore:
Timestamp:
25/03/13 10:22:00 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22698: [CEDA Site Python Port] MyCEDA Login needs to be more user-friendly
 http://team.ceda.ac.uk/trac/ceda/ticket/22698

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/dj_security/trunk/setup.py

    r8736 r8738  
    55import os 
    66 
     7def collect_static(root_dir, dir_name, resources): 
     8    for dirpath, dirnames, filenames \ 
     9        in os.walk(os.path.join(root_dir, dir_name)): 
     10    # remove the 'cedatheme_mf54' part of the path 
     11        basepath = dirpath.split(os.path.sep, 1)[1] 
     12        resources.extend([os.path.join(basepath, filename) 
     13                 for filename in filenames]) 
     14 
     15base_name='dj_security' 
    716 
    817v_file = open(os.path.join(os.path.dirname(__file__),  
    9                        'dj_security', '__init__.py')) 
     18                       base_name, '__init__.py')) 
    1019VERSION = re.compile(r".*__version__ = '(.*?)'", 
    1120                     re.S).match(v_file.read()).group(1) 
    1221 
     22#This section collects the NOT PYTHON files to distribute 
     23resources = [] 
     24for dirpath, dirnames, filenames in os.walk(os.path.join(base_name, base_name)): 
     25    # remove the 'pytz' part of the path 
     26    basepath = dirpath.split(os.path.sep, 1)[1] 
     27    resources.extend([os.path.join(basepath, filename) 
     28                     for filename in filenames]) 
     29for dir_name in ['static', 'templates']: 
     30    collect_static(base_name, dir_name, resources) 
     31     
     32package_data = {base_name: resources} 
     33 
    1334setup( 
    14     name='dj_security', 
     35    name=base_name, 
    1536    version=VERSION, 
    1637    author=u'Maurizio Nagni', 
    1738    author_email='maurizio.nagni@stfc.ac.uk', 
    18     package_dir = {'dj_security':'dj_security'}, # tell distutils packages are under cedaMoles     
     39    package_dir = {base_name:base_name}, # tell distutils packages are under cedaMoles     
    1940    packages=find_packages(), # include all packages under this directory     
    2041    url='http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/dj_security',   
     
    3657                        'django-authopenid==1.0.1', 
    3758                        'userdb_model'], 
     59     package_data=package_data,  
    3860) 
Note: See TracChangeset for help on using the changeset viewer.