Django

Code

Changeset 789

Show
Ignore:
Timestamp:
10/06/05 09:30:35 (3 years ago)
Author:
adrian
Message:

Changed django.core.management to remove a couple of hard-coded slashes from os.path.join calls. Thanks, Stuart Langridge

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management.py

    r784 r789  
    1717# Use django.__path__[0] because we don't know which directory django into 
    1818# which has been installed. 
    19 PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf/%s_template') 
    20 ADMIN_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf/admin_templates') 
     19PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template') 
     20ADMIN_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', 'admin_templates') 
    2121 
    2222def _get_packages_insert(app_label): 
     
    161161    app_label = mod._MODELS[0]._meta.app_label 
    162162    output.append(_get_packages_insert(app_label)) 
    163     app_dir = os.path.normpath(os.path.join(os.path.dirname(mod.__file__), '../sql')) 
     163    app_dir = os.path.normpath(os.path.join(os.path.dirname(mod.__file__), '..', 'sql')) 
    164164    for klass in mod._MODELS: 
    165165        opts = klass._meta 
     
    377377    # Populate TEMPLATE_DIRS for the admin templates, based on where Django is 
    378378    # installed. 
    379     admin_settings_file = os.path.join(directory, project_name, 'settings/admin.py') 
     379    admin_settings_file = os.path.join(directory, project_name, 'settings', 'admin.py') 
    380380    settings_contents = open(admin_settings_file, 'r').read() 
    381381    fp = open(admin_settings_file, 'w') 
     
    384384    fp.close() 
    385385    # Create a random SECRET_KEY hash, and put it in the main settings. 
    386     main_settings_file = os.path.join(directory, project_name, 'settings/main.py') 
     386    main_settings_file = os.path.join(directory, project_name, 'settings', 'main.py') 
    387387    settings_contents = open(main_settings_file, 'r').read() 
    388388    fp = open(main_settings_file, 'w') 
     
    398398    # Determine the project_name a bit naively -- by looking at the name of 
    399399    # the parent directory. 
    400     project_dir = os.path.normpath(os.path.join(directory, '../')) 
     400    project_dir = os.path.normpath(os.path.join(directory, '..')) 
    401401    project_name = os.path.basename(project_dir) 
    402402    _start_helper('app', app_name, directory, project_name)