Guest User

Untitled

a guest
May 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. """
  2. The ultimate process to test the status and update capabilities of the server
  3. The processes shoul be requested as follows:
  4. ../wps.py?request=execute
  5. &service=wps
  6. &version=1.0.0
  7. &identifier=helloworld
  8. &status=true
  9. &storeExecuteResponse=true
  10.  
  11. Adapted from Jorge's ultimatequestionprocess by Christian vdB
  12.  
  13. """
  14.  
  15. from pywps.Process import WPSProcess
  16. class Process(WPSProcess):
  17. def __init__(self):
  18. # init process
  19. WPSProcess.__init__(self,
  20. identifier="helloworld", #the same as the file name
  21. title="Hello world",
  22. version = "0.1",
  23. storeSupported = "true",
  24. statusSupported = "true",
  25. abstract="Hello world",
  26. grassLocation =False)
  27. #No need for inputs since Execute will start the process
  28. self.textout=self.addLiteralOutput(identifier = "textout",
  29. dataType=type(" "),
  30. title = "Hello world")
  31.  
  32.  
  33. def execute(self):
  34. import time
  35. self.status.set("Preparing....", 0)
  36. for i in xrange(1, 11):
  37. time.sleep(1)
  38. self.status.set("Thinking.....", i*10)
  39. #The final answer
  40. self.textout.setValue("Hello, world!")
Add Comment
Please, Sign In to add comment