PEATSA/WebApp/UtilityFunctions.py
def ConnectionFromConfiguration(configuration):

	'''Creates and returns a connection based on the information in the configuration object.
	
	The configuration object should be an instance of the Core.Environment.Configuration class.
	The underlying configuration file should contain a section 'DATABASE' with the value
	host, user, password and database'''

	connection = MySQLdb.connect(host=configuration.get("DATABASE", "host"),
				 user=configuration.get("DATABASE","user"),
				 passwd=configuration.get("DATABASE", "password"), 
				 db=configuration.get("DATABASE", "database"))	
				 
	return connection
Creates and returns a connection based on the information in the configuration object.
	
	The configuration object should be an instance of the Core.Environment.Configuration class.
	The underlying configuration file should contain a section 'DATABASE' with the value
	host, user, password and database
Creates and returns a connection based on the information in the configuration object.
The configuration object should be an instance of the Core.Environment.Configuration class.
The underlying configuration file should contain a section 'DATABASE' with the value
host, user, password and database
Creates and returns a connection based on the information in the configuration object . The configuration object should be an instance of the Core . Environment . Configuration class . The underlying configuration file should contain a section ' DATABASE ' with the value host user password and database
def ConnectionFromConfiguration(configuration):
	connection = MySQLdb.connect(host=configuration.get("DATABASE", "host"),
				 user=configuration.get("DATABASE","user"),
				 passwd=configuration.get("DATABASE", "password"), 
				 db=configuration.get("DATABASE", "database"))	
	return connection
def ConnectionFromConfiguration ( configuration ) : connection = MySQLdb . connect ( host = configuration . get ( "DATABASE" , "host" ) , user = configuration . get ( "DATABASE" , "user" ) , passwd = configuration . get ( "DATABASE" , "password" ) , db = configuration . get ( "DATABASE" , "database" ) ) return connection
Creates and returns a connection based on the information in the configuration object.
Creates and returns a connection based on the information in the configuration object .
'''Creates and returns a connection based on the information in the configuration object.
	
	The configuration object should be an instance of the Core.Environment.Configuration class.
	The underlying configuration file should contain a section 'DATABASE' with the value
	host, user, password and database'''
configuration