def start(self, applicationModel): self.logger = applicationModel.getEngine().getService(IZAppServiceIDs.LOGGER_SERVICE_ID) self.logger.debug(u"Auto-Update Service started.") #$NON-NLS-1$ self.stopped = False runner = ZAutoUpdateRunnable(self, True) thread = ZThread(runner, u"AutoUpdate", True) #$NON-NLS-1$ thread.start()
def _startListening(self): sysProfile = self.applicationModel.getSystemProfile() port = sysProfile.getProperties().getPropertyInt( u"/system-properties/singleton/port", 84113) #$NON-NLS-1$ self.server = SimpleXMLRPCServer.SimpleXMLRPCServer( (u"localhost", port), logRequests=False) #$NON-NLS-1$ self.server.register_instance(ZRavenRPCServer(self)) self.logger.debug(u"Singleton server created on port %d." % port) #$NON-NLS-1$ thread = ZThread(self, u"ZSingletonService", True) #$NON-NLS-1$ thread.start()
def onBeginBackroundTask(self, event): #@UnusedVariable self._cancelTask() # save button states self.bgTaskPreviousButtonState = self._isButtonEnabledById( ZID_PREVIOUS) self.bgTaskNextButtonState = self._isButtonEnabledById(ZID_NEXT) # disable buttons self._enableNextButton(False) self._enablePreviousButton(False) self.bgTask = event.getTask() # wizardTask.run() thread = ZThread(self.bgTask, u"ZWizardTaskThread", True) #$NON-NLS-1$ thread.start() event.Skip()
def start(self, applicationModel): self.queue = Queue(0) userProfile = applicationModel.getUserProfile() self.usageDir = userProfile.getDirectory(u"usage") #$NON-NLS-1$ engine = applicationModel.getEngine() self.logger = engine.getService(IZBlogAppServiceIDs.LOGGER_SERVICE_ID) self.logger.debug(u"Anonymous Usage Statistics Service started.") #$NON-NLS-1$ accountStore = engine.getService(IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID) dataStore = engine.getService(IZBlogAppServiceIDs.DATA_STORE_SERVICE_ID) mediaStoreService = engine.getService(IZBlogAppServiceIDs.MEDIA_STORAGE_SERVICE_ID) accountStore.addListener(self) dataStore.addListener(self) mediaStoreService.addListener(self) self.done = False self.running = True thread = ZThread(self, u"ZUsageStatisticsService", True) #$NON-NLS-1$ thread.start()
def checkForUpdate(self, onlyPromptWhenNewVersionIsAvailable = True): runner = ZAutoUpdateRunnable(self, onlyPromptWhenNewVersionIsAvailable) thread = ZThread(runner, u"AutoUpdate", True) #$NON-NLS-1$ thread.start()
def startTest(self): self.thread = ZThread(self.ztest, u"ZTestThread", True) #$NON-NLS-1$ self.thread.start()
def _resumeTask(self, task): task.attachListener(self) name = u"bgtask:id:%s" % str(task.getId()) #$NON-NLS-1$ thread = ZThread(task, name, True) thread.start()
def cancelAsync(self): thread = ZThread(ZMethodRunnable(self.cancel), u"CancelTask", True) #$NON-NLS-1$ thread.start()
def onRefreshBlogList(self, event): #@UnusedVariable thread = ZThread(ZListBlogsTasks(self), u"ZSynchronizeAccountBlogsDialog.ZListBlogsTasks", True) #$NON-NLS-1$ thread.start()