PEATSA/Core/Environment.py
def __readConfigurationsFromDefaultLocations(self):
	
		'''Checks if a configuration file exists at set of default locations and reads it
		
		The locations are (in order)
			- the current directory
			- the value of PEATSA_CONFIGURATION_PATH environment variable
			- the users home directory
		
		The first found configuration file is used.
		
		Returns:
			The configuration object if one was successfully created.
			None otherwise.
		
		Exceptions:
			Raises an Exceptions.ConfigurationError if the configuration is
			missing any of the required sections.'''
			
		default = ConfigParser.SafeConfigParser()
		default.optionxform = str
	
		#First check if any configuration files exist in default locations
		current = os.path.abspath('proteinDesignTool.conf')
		home = os.path.join(os.path.expanduser('~'), 'proteinDesignTool.conf')
		array = [home, current]
		
		if os.environ.has_key('PEATSA_CONFIGURATION_PATH'):
			env = os.environ['PEATSA_CONFIGURATION_PATH']
			env = os.path.join(env, 'proteinDesignTool.conf')
			array.insert(1, env)
		
		#Note this first read $HOME if it exists and then overrides it with current
		result = default.read(array)
		if len(result) == 0:
			default = None
		else:
			#Check if all necessary sections are present
			list = []
			if not self.__validateConfiguration(default, list):
				raise Exceptions.ConfigurationError, "Configuration file %s not valid.\n%s" % (result, list)	
	
		return default
Checks if a configuration file exists at set of default locations and reads it
		
		The locations are (in order)
			- the current directory
			- the value of PEATSA_CONFIGURATION_PATH environment variable
			- the users home directory
		
		The first found configuration file is used.
		
		Returns:
			The configuration object if one was successfully created.
			None otherwise.
		
		Exceptions:
			Raises an Exceptions.ConfigurationError if the configuration is
			missing any of the required sections.
Checks if a configuration file exists at set of default locations and reads it
The locations are (in order)
the current directory
the value of PEATSA_CONFIGURATION_PATH environment variable
the users home directory

The first found configuration file is used.

The configuration object if one was successfully created.
None otherwise.

Raises an Exceptions.ConfigurationError if the configuration is
missing any of the required sections.
Checks if a configuration file exists at set of default locations and reads it The locations are ( in order ) the current directory the value of PEATSA_CONFIGURATION_PATH environment variable the users home directory The first found configuration file is used . The configuration object if one was successfully created . None otherwise . Raises an Exceptions . ConfigurationError if the configuration is missing any of the required sections .
def __readConfigurationsFromDefaultLocations(self):
		default = ConfigParser.SafeConfigParser()
		default.optionxform = str
		current = os.path.abspath('proteinDesignTool.conf')
		home = os.path.join(os.path.expanduser('~'), 'proteinDesignTool.conf')
		array = [home, current]
		if os.environ.has_key('PEATSA_CONFIGURATION_PATH'):
			env = os.environ['PEATSA_CONFIGURATION_PATH']
			env = os.path.join(env, 'proteinDesignTool.conf')
			array.insert(1, env)
		result = default.read(array)
		if len(result) == 0:
			default = None
		else:
			list = []
			if not self.__validateConfiguration(default, list):
				raise Exceptions.ConfigurationError, "Configuration file %s not valid.\n%s" % (result, list)	
		return default
def __readConfigurationsFromDefaultLocations ( self ) : default = ConfigParser . SafeConfigParser ( ) default . optionxform = str current = os . path . abspath ( 'proteinDesignTool.conf' ) home = os . path . join ( os . path . expanduser ( '~' ) , 'proteinDesignTool.conf' ) array = [ home , current ] if os . environ . has_key ( 'PEATSA_CONFIGURATION_PATH' ) : env = os . environ [ 'PEATSA_CONFIGURATION_PATH' ] env = os . path . join ( env , 'proteinDesignTool.conf' ) array . insert ( 1 , env ) result = default . read ( array ) if len ( result ) == 0 : default = None else : list = [ ] if not self . __validateConfiguration ( default , list ) : raise Exceptions . ConfigurationError , "Configuration file %s not valid.\n%s" % ( result , list ) return default
Checks if a configuration file exists at set of default locations and reads it
The locations are (in order)
 the current directory
 the value of PEATSA_CONFIGURATION_PATH environment variable
 the users home directory
Checks if a configuration file exists at set of default locations and reads it The locations are ( in order ) the current directory the value of PEATSA_CONFIGURATION_PATH environment variable the users home directory
'''Checks if a configuration file exists at set of default locations and reads it
		
		The locations are (in order)
			- the current directory
			- the value of PEATSA_CONFIGURATION_PATH environment variable
			- the users home directory
		
		The first found configuration file is used.
		
		Returns:
			The configuration object if one was successfully created.
			None otherwise.
		
		Exceptions:
			Raises an Exceptions.ConfigurationError if the configuration is
			missing any of the required sections.''' #First check if any configuration files exist in default locations #Note this first read $HOME if it exists and then overrides it with current #Check if all necessary sections are present
self