Changeset 842 for SHX/trunk


Ignore:
Timestamp:
11/08/12 15:20:54 (8 years ago)
Author:
marcus
Message:
  • option to make one configuration file the only one
Location:
SHX/trunk/SeismicHandler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/config/runtime.py

    r781 r842  
    190190        mergedConfig = ConfigParser.SafeConfigParser() 
    191191 
     192        single = False 
    192193        for src in dirs: 
     194            import pdb; pdb.set_trace() 
    193195            config = ConfigParser.SafeConfigParser() 
    194196            config.read(src) 
     197 
     198            # check for single usage 
     199            if "single" in config.sections(): 
     200                msg = "Using single configuration: %s" % src 
     201                log_message("info.runtime", msg) 
     202                single = True 
     203                # reset former configs 
     204                conf = AttribDict() 
     205                vars = AttribDict() 
     206                mergedConfig = ConfigParser.SafeConfigParser() 
    195207 
    196208            for s in config.sections(): 
     
    235247                    del conf[s]["include"] 
    236248                    mergedConfig.remove_option(s, "include") 
     249 
     250            if single: 
     251                break 
    237252 
    238253        # since configparser doesn't preserve order of entries, variables will 
  • SHX/trunk/SeismicHandler/shx.conf

    r561 r842  
    1111# "include" statement (example and comments at [graphics] section). 
    1212# 
     13 
     14# If you uncomment the next (empty) section, only this configuration 
     15# file will be used. This enables you have have an own configuration 
     16# regardless if there is a global one (/etc/SeismicHandler/shx.conf) or 
     17# one supplied by installation ([SHX]/shx.conf). 
     18# You should use this setting *ONLY* inside ~/.shx/shx.conf and if you 
     19# know what you're doing! 
     20##[single] 
    1321 
    1422[paths] 
Note: See TracChangeset for help on using the changeset viewer.