Package Ganga :: Package Utility :: Package Config
[hide private]
[frames] | no frames]

Source Code for Package Ganga.Utility.Config

 1  from Config import getConfig,makeConfig, ConfigError, configure, allConfigs,setConfigOption, expandConfigPath, config_scope, setSessionValue, getFlavour 
 2   
 3  ## from Config import getConfigDict 
 4   
 5  # here are some useful option filters  
6 -def expandvars(c,v):
7 """The ~ and $VARS are automatically expanded. """ 8 import os.path 9 return os.path.expanduser(os.path.expandvars(v))
10
11 -def expandgangasystemvars(c, v):
12 """Expands vars with the syntax '@{VAR}' from the System config item.""" 13 system = getConfig('System') 14 for key in system.options.iterkeys(): 15 option = '@{%s}' % key 16 if option in v: 17 v = v.replace(option,system[key]) 18 return v
19