WPS Execute request handler

pywps.Wps.Execute.TEMPDIRPREFIX

prefix of temporary pywps directory

Class Execute

class pywps.Wps.Execute.Execute(wps, processes=None, spawned=False)

This class performs the Execute request of WPS specification and formats output

Parameters:wpspywps.Pywps
accepted

Process accepted indicator string

started

Process started indicator string

succeeded

Process succeeded indicator string

paused

Process paused indicator string

failed

Process failed indicator string

curdir

Curent working directory, when the process is started

pid

Id of currently running process on the system level

id

Unique WPS Process identification

statusLocation

Location, where status and response files are stored

outputFileName

Name of the file, where status informations are printed to

outputFile

List of file objects, where status informations are printed to

storeRequired

Storing of process results is required

statusRequired

Process should run in assynchronous mode

lineageRequired

Include input and output description to final response document (just like DescribeProcess would do it)

status

Current process status, one of processaccepted, processstarted, processsucceeded, processfailed

statusMessage

Text message or comment to particular status

percent

Percent done

exceptioncode

Code of exception

locator

Locator of exception

statusTime

current status time

dirsToBeRemoved

List of directories, which should be removed, after the process is successfully calculated

workingDir

working directory, where the calculation is done

grass

pywps.Grass.Grass

rawDataOutput

indicates, if there is any output, which should be returned directly (without final xml response document)

umn

pywps.UMN.UMN

UMN MapServer - mapscript handler

spawned

Indicates, wheather this is running as child process of the main process

calculateMaxInputSize()

Calculates maximal size for input file based on configuration and units

Returns:maximum file size bytes
checkMimeTypeOutput(output)

Checks the complexData output to determine if the mimeType is correct. if mimeType is not in the list defined by the user then it will log it as an error, no further action will be taken Mainly used by: _asReferenceOutput,_complexOutput,_lineageComplexOutput,_lineageComplexReference Note: checkMimeTypeIn will set the output’s format from the first time, if the user doesnt define an outputmimetype, we’ll use the first one in the list (set by CheckMimeTypeIn), the mimeType will then be validate using ligmagic

cleanEnv()

Removes temporary created files and dictionaries

consolidateInputs()

Download and control input data, defined by the client

consolidateOutputs()

Set desired attributes (e.g. asReference) for each output

executeProcess()

Calls ‘execute’ method of the process, catches possible exceptions and set process failed or succeeded

getRequestedOutputs()

Called from processOutputs and cross references the processe’s outputs and the ones requested, returning a list of ouputs that need to be present in the XML response document

getSessionId()

Returns unique Execute session ID

Return type:string
Returns:unique id:
"pywps-"+uuid.uuid1()
getSessionIdFromStatusLocation(statusLocation)

Parses the statusLocation, and gets the unique session ID from it

Note

Not in use, maybe should be removed.

initEnv()

Create process working directory, initialize GRASS environment, if required.

initProcess()

Setting and controlling input values, set by the client. Also the processes from PYWPS_PROCESS directory or default directory is imported.

lineageInputs()

Called, if lineage request was set. Fills the <DataInputs> part of output XML document.

onInputProblem(what, why)

This method is used for rewriting onProblem method of each input

Parameters:
  • what – locator of the problem
  • why – possible reason of the problem
onOutputProblem(what, why)

This method logs the existance of problens in the complexData mainly (output mimeType?) :param what: locator of the problem :param why: possible reason of the problem

onStatusChanged()

This method is used for redefinition of self.process.status class

outputDefinitions()

Called, if lineage request was set. Fills the <OutputDefinitions> part of output XML document.

processDescription()

Fills Identifier, Title and Abstract, eventually WSDL, Metadata and Profile parts of the output XML document

processOutputs()

Fill <ProcessOutputs> part in the output XML document This method is called if, self.status == ProcessSucceeded

promoteStatus(status, statusMessage=0, percent=0, exceptioncode=0, locator=0, output=None)

Sets status of currently performed Execute request

Parameters:
  • status – name of the status
  • statusMessage – message, which should appear in output xml file
  • percent – percent done message
  • exceptioncode – eventually exception
  • locator – where the problem occurred
serviceInstanceUrl()

Creates URL of GetCapabilities for this WPS

Returns:server address
setRawData()

Sets response and contentType

Table Of Contents

Previous topic

WPS DescribeProcess request handler

This Page