Ignore:
Timestamp:
06/03/09 10:17:27 (11 years ago)
Author:
spascoe
Message:

Put default ini files in the package hierarchy. NAPPY_BASE_DIR is still
used if set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/branches/nappy-eggable/nappy/utils/parse_config.py

    r5068 r5071  
    1111import os 
    1212 
    13 _here = os.path.dirname(__file__) 
    1413 
    1514# Global variables 
    16 base_dir = os.environ.get("NAPPY_BASE_DIR", os.path.join(_here, '..')) 
     15 
     16# base_dir is taken from the environment first and then from nappy.config 
     17# as a fallback. 
     18if 'NAPPY_BASE_DIR' in os.environ: 
     19    base_dir = os.environ["NAPPY_BASE_DIR"] 
     20else: 
     21    _here = os.path.dirname(__file__) 
     22    base_dir = os.path.join(_here, '../config') 
     23 
    1724config_file = os.path.join(base_dir, "nappy.ini") 
    1825config_dict = None 
Note: See TracChangeset for help on using the changeset viewer.