Esempio n. 1
0
 def runCommandAsynchronously(self, cmd_name, run_function, async_callback,
                              *args, **kwargs):
     # Run asynchronously
     async_svc = components.classes["@activestate.com/koAsyncService;1"].\
                     getService(components.interfaces.koIAsyncService)
     async_op = koAsyncOperationBase(run_function, *args, **kwargs)
     async_svc.run("Stackato %s" % (cmd_name), async_op, async_callback, [],
                   False)
     return async_op
Esempio n. 2
0
 def runCommandAsynchronously(self, cmd_name, run_function, async_callback,
                              *args, **kwargs):
     # Run asynchronously
     async_svc = components.classes["@activestate.com/koAsyncService;1"].\
                     getService(components.interfaces.koIAsyncService)
     async_op = koAsyncOperationBase(run_function, *args, **kwargs)
     async_svc.run("Stackato %s" % (cmd_name),
                   async_op, async_callback, [], False)
     return async_op
Esempio n. 3
0
 def runCommandInTerminal(self, async_callback, terminalHandler, args, env):
     # Run asynchronously
     self.terminalHandler = UnwrapObject(terminalHandler)
     import koprocessutils
     currentEnv = koprocessutils.getUserEnv()
     newEnvParts = env.split(";")
     for part in newEnvParts:
         parts = part.split("=")
         if len(parts) == 2:
             currentEnv[parts[0]] = parts[1]
         else:
             currentEnv[parts[0]] = ""
     self.env = currentEnv
     async_svc = components.classes["@activestate.com/koAsyncService;1"].\
                     getService(components.interfaces.koIAsyncService)
     async_op = koAsyncOperationBase(self._doRunCommandInTerminal, args)
     async_svc.run("Stackato %s" % (args[0]), async_op, async_callback, [],
                   False)
     return async_op
Esempio n. 4
0
 def runCommandInTerminal(self, async_callback, terminalHandler, args, env):
     # Run asynchronously
     self.terminalHandler = UnwrapObject(terminalHandler)
     import koprocessutils
     currentEnv = koprocessutils.getUserEnv()
     newEnvParts = env.split(";")
     for part in newEnvParts:
         parts = part.split("=")
         if len(parts) == 2:
             currentEnv[parts[0]] = parts[1]
         else:
             currentEnv[parts[0]] = ""
     self.env = currentEnv
     async_svc = components.classes["@activestate.com/koAsyncService;1"].\
                     getService(components.interfaces.koIAsyncService)
     async_op = koAsyncOperationBase(self._doRunCommandInTerminal, args)
     async_svc.run("Stackato %s" % (args[0]),
                   async_op, async_callback, [], False)
     return async_op