PEATSA/WebApp/JobSubmission.py
def ConstructErrorURL(domain="PDT.UnknownDomain", 
		description="Unexpected Error", 
		detailedDescription="Unknown error while processing job",
		recoverySuggestion="Please contact the developers with details of what you were doing"):

	'''Constructs an URL for the WebApps error page
	
	Automatically determines the server name and port from os.envrion
	
	Parameters
		domain - The domain of the error - Indicates what part of the program failed
		description - A short string which very briefly describes what happened
		detailedDescription - A longer string elaborating on the error
		recoverySuggestion - A string explaining what to do, if known
		
	Return 
		A string containing an URL'''
		
	#Add error data as GET data - Possibly a better way?
	#e.g. generate html here?
	dataDict = {"domain":domain,
			"description":description, 
			"detailedDescription":detailedDescription, 
			"recoverySuggestion":recoverySuggestion}
	data = ["%s=%s" % (key, dataDict[key]) for key in dataDict.keys()]
	query = "&".join(data)
	
	location = os.environ['SERVER_NAME'] + ":" + os.environ['SERVER_PORT']
	components = ("http", location, "PEATSA/Pages/Error.php", "", query, "")	
	return urlparse.urlunparse(components)
Constructs an URL for the WebApps error page
	
	Automatically determines the server name and port from os.envrion
	
	Parameters
		domain - The domain of the error - Indicates what part of the program failed
		description - A short string which very briefly describes what happened
		detailedDescription - A longer string elaborating on the error
		recoverySuggestion - A string explaining what to do, if known
		
	Return 
		A string containing an URL
Constructs an URL for the WebApps error page
Automatically determines the server name and port from os.envrion



Return
A string containing an URL
Constructs an URL for the WebApps error page Automatically determines the server name and port from os . envrion Return A string containing an URL
def ConstructErrorURL(domain="PDT.UnknownDomain", 
		description="Unexpected Error", 
		detailedDescription="Unknown error while processing job",
		recoverySuggestion="Please contact the developers with details of what you were doing"):
	dataDict = {"domain":domain,
			"description":description, 
			"detailedDescription":detailedDescription, 
			"recoverySuggestion":recoverySuggestion}
	data = ["%s=%s" % (key, dataDict[key]) for key in dataDict.keys()]
	query = "&".join(data)
	location = os.environ['SERVER_NAME'] + ":" + os.environ['SERVER_PORT']
	components = ("http", location, "PEATSA/Pages/Error.php", "", query, "")	
	return urlparse.urlunparse(components)
def ConstructErrorURL ( domain = "PDT.UnknownDomain" , description = "Unexpected Error" , detailedDescription = "Unknown error while processing job" , recoverySuggestion = "Please contact the developers with details of what you were doing" ) : dataDict = { "domain" : domain , "description" : description , "detailedDescription" : detailedDescription , "recoverySuggestion" : recoverySuggestion } data = [ "%s=%s" % ( key , dataDict [ key ] ) for key in dataDict . keys ( ) ] query = "&" . join ( data ) location = os . environ [ 'SERVER_NAME' ] + ":" + os . environ [ 'SERVER_PORT' ] components = ( "http" , location , "PEATSA/Pages/Error.php" , "" , query , "" ) return urlparse . urlunparse ( components )
Constructs an URL for the WebApps error page
Automatically determines the server name and port from os.envrion
Constructs an URL for the WebApps error page Automatically determines the server name and port from os . envrion
'''Constructs an URL for the WebApps error page
	
	Automatically determines the server name and port from os.envrion
	
	Parameters
		domain - The domain of the error - Indicates what part of the program failed
		description - A short string which very briefly describes what happened
		detailedDescription - A longer string elaborating on the error
		recoverySuggestion - A string explaining what to do, if known
		
	Return 
		A string containing an URL''' #Add error data as GET data - Possibly a better way? #e.g. generate html here?
domain
description
detailedDescription
recoverySuggestion