Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def doPywps(self,request, response, inputQuery,method):
# create the WPS object
try:
wps = pywps.Pywps(method)
if wps.parseRequest(inputQuery):
pywps.debug(wps.inputs)
wpsresponse = wps.performRequest(processes=[self.getProcesses()])
if wpsresponse:
pywps.response.response(wps.response, response, wps.parser.isSoap,self.wps.parser.isSoapExecute)
except WPSException,e:
pywps.response.response(e, response)
config.loadConfiguration(os.path.join(here,"pywpsio.cfg"))
os.environ["PYWPS_TEMPLATES"] = os.path.join(here,"Templates")
ioBridgeProcesses = [ioBridge.createIOBridgeProcess()]
# create the WPS object
try:
wps = pywps.Pywps(method)
if wps.parseRequest(inputQuery):
pywps.debug(wps.inputs)
wpsresponse = wps.performRequest(processes=ioBridgeProcesses)
if wpsresponse:
#pywps.response.response(wps.response, response, wps.parser.isSoap)
pywps.response.response(wps.response, response, wps.parser.isSoap)
except WPSException,e:
pywps.response.response(e, response)
self.templateProcessor.set("processfailed", 1)
if self.statusMessage:
self.templateProcessor.set("exceptiontext", self.statusMessage)
self.templateProcessor.set("exceptioncode", self.exceptioncode)
if self.locator:
self.templateProcessor.set("locator", self.locator)
# update response
self.response = self.templateProcessor.__str__()
# print status
if self.storeRequired and (self.status == self.accepted or
#self.status == self.succeeded or
self.status == self.failed or
(self.spawned and self.status != self.succeeded)):
pywps.response.response(self.response,
self.outputFile,
self.wps.parser.soapVersion,
self.wps.parser.isSoap,
self.wps.parser.isSoapExecute,
self.contentType,isPromoteStatus=True)
#self.wps.parser.isSoapExecute
if self.status == self.started:
LOGGER.info("Status [%s][%.1f]: %s" %\
(self.status,float(self.percent), self.statusMessage))
else:
LOGGER.info("Status [%s]: %s" % (self.status, self.statusMessage))
here = os.path.abspath(os.path.join(os.path.dirname(__file__)))
config.loadConfiguration(os.path.join(here,"pywpsio.cfg"))
os.environ["PYWPS_TEMPLATES"] = os.path.join(here,"Templates")
ioBridgeProcesses = [ioBridge.createIOBridgeProcess()]
# create the WPS object
try:
wps = pywps.Pywps(method)
if wps.parseRequest(inputQuery):
pywps.debug(wps.inputs)
wpsresponse = wps.performRequest(processes=ioBridgeProcesses)
if wpsresponse:
#pywps.response.response(wps.response, response, wps.parser.isSoap)
pywps.response.response(wps.response, response, wps.parser.isSoap)
except WPSException,e:
pywps.response.response(e, response)
self.templateProcessor.set("processfailed", 1)
if self.statusMessage:
self.templateProcessor.set("exceptiontext", self.statusMessage)
self.templateProcessor.set("exceptioncode", self.exceptioncode)
if self.locator:
self.templateProcessor.set("locator", self.locator)
# update response
self.response = self.templateProcessor.__str__()
# print status
if self.storeRequired and (self.statusRequired or
self.status == self.accepted or
#self.status == self.succeeded or
self.status == self.failed):
pywps.response.response(self.response,
self.outputFile,
self.wps.parser.soapVersion,
self.wps.parser.isSoap,
self.contentType)
if self.status == self.started:
logging.info("Status [%s][%.1f]: %s" %\
(self.status,float(self.percent), self.statusMessage))
else:
logging.info("Status [%s]: %s" % (self.status, self.statusMessage))
os.environ["PYWPS_TEMPLATES"] = os.path.join(here,"Templates")
cstProcesses = []
cstProcesses = coreFunctions.createCstCoreFunctionProcesses()
# create the WPS object
try:
wps = pywps.Pywps(method)
if wps.parseRequest(inputQuery):
pywps.debug(wps.inputs)
wpsresponse = wps.performRequest(processes=cstProcesses)
if wpsresponse:
#pywps.response.response(wps.response, response, wps.parser.isSoap)
pywps.response.responseJava(wps.response, response, wps.parser.isSoap)
except WPSException,e:
pywps.response.response(e, response)