Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from TestThreadModules import *
- class TestThreadCommand(TextCommand, ThreadedCommand):
- def finish(self, stuff):
- messageBox("%s" % stuff)
- def doStuff(self, view):
- time.sleep(3)
- return "Yay!"
- @wrappedView
- def onActivated(self, v, cmds, options):
- print options.syntax, v.substr(v.sel1)
- @wrappedView
- def run(self, view, cmds, options, args):
- busyMsg = 'Only "maxThreads" (%s) thread at a time' % self.maxThreads
- self.doInThread(self.doStuff, view)\
- .andThen(self.finish)\
- .elseIfBusy(statusMessage, busyMsg)
Add Comment
Please, Sign In to add comment