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

Class ConfigOption

source code

Configuration Option has a name, default value and a docstring.

Metainformation:
   * type - if not specified, then the type is inferred from the default value, type may be a type object such as type(1), StringType, type(None) or a list
   of such objects - in this case any type in the list is accepted
   * examples - example how to use the option
   * hidden - True => do not show the option at the level of GPI proxy (default False)
   * cfile - False => do not put the option in the generated config file (default True)
   * filter - None => filter the option value when set (session and user levels)
   * typelist - None => a typelist as in GPI schema 
The configuration option may also define the session_value and default_value. The value property gives the effective value.

Instance Methods [hide private]
 
__init__(self, name) source code
 
defineOption(self, default_value, docstring, **meta) source code
 
setSessionValue(self, session_value) source code
 
setUserValue(self, user_value) source code
 
overrideDefaultValue(self, default_value) source code
 
__getattr__(self, name) source code
 
__setattr__(self, name, value) source code
 
check_defined(self) source code
 
transform_PATH_option(self, new_value, current_value) source code
 
convert_type(self, x_name)
Convert the type of session_value or user_value (referred to by x_name) according to the types defined by the self.
source code
Method Details [hide private]

convert_type(self, x_name)

source code 

Convert the type of session_value or user_value (referred to by x_name) according to the types defined by the self. If the option has not been defined or the x_name in question is not defined, then this method is no-op. If conversion cannot be performed (type mismatch) then raise ConfigError.