Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- The ultimate process to test the status and update capabilities of the server
- The processes shoul be requested as follows:
- ../wps.py?request=execute
- &service=wps
- &version=1.0.0
- &identifier=helloworld
- &status=true
- &storeExecuteResponse=true
- Adapted from Jorge's ultimatequestionprocess by Christian vdB
- """
- from pywps.Process import WPSProcess
- class Process(WPSProcess):
- def __init__(self):
- # init process
- WPSProcess.__init__(self,
- identifier="helloworld", #the same as the file name
- title="Hello world",
- version = "0.1",
- storeSupported = "true",
- statusSupported = "true",
- abstract="Hello world",
- grassLocation =False)
- #No need for inputs since Execute will start the process
- self.textout=self.addLiteralOutput(identifier = "textout",
- dataType=type(" "),
- title = "Hello world")
- def execute(self):
- import time
- self.status.set("Preparing....", 0)
- for i in xrange(1, 11):
- time.sleep(1)
- self.status.set("Thinking.....", i*10)
- #The final answer
- self.textout.setValue("Hello, world!")
Add Comment
Please, Sign In to add comment