Ignore:
Timestamp:
Oct 1, 2014 7:12:29 PM (8 years ago)
Author:
toby
Message:

add config file support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branch/logging/GSASIIpath.py

    r1413 r1511  
    6060if newpath not in sys.path: sys.path.append(newpath)
    6161
     62# setup read of config.py, if present
     63try:
     64    import config
     65    configDict = config.__dict__
     66    import inspect
     67    vals = [True for i in inspect.getmembers(config) if '__' not in i[0]]
     68    print str(len(vals))+' values read from config file '+os.path.abspath(config.__file__)
     69except ImportError:
     70    configDict = {}
     71   
     72def GetConfigValue(key):
     73    'Return the configuration file value for key or None if not present'
     74    return configDict.get(key)
     75
    6276# routines for looking a version numbers in files
    6377version = -1
Note: See TracChangeset for help on using the changeset viewer.