Guest User

Untitled

a guest
Apr 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. from TestThreadModules import *
  2.  
  3. class TestThreadCommand(TextCommand, ThreadedCommand):
  4. def finish(self, stuff):
  5. messageBox("%s" % stuff)
  6.  
  7. def doStuff(self, view):
  8. time.sleep(3)
  9. return "Yay!"
  10.  
  11. @wrappedView
  12. def onActivated(self, v, cmds, options):
  13. print options.syntax, v.substr(v.sel1)
  14.  
  15. @wrappedView
  16. def run(self, view, cmds, options, args):
  17. busyMsg = 'Only "maxThreads" (%s) thread at a time' % self.maxThreads
  18.  
  19. self.doInThread(self.doStuff, view)\
  20. .andThen(self.finish)\
  21. .elseIfBusy(statusMessage, busyMsg)
Add Comment
Please, Sign In to add comment