def createApplicationEvent(name, category, **kw): try: from storytext import applicationEvent # Everything that comes from here is to do with editing files in external programs applicationEvent(name, category, **kw) except ImportError: pass
def applicationEvent(self, name, **kw): try: from storytext import applicationEvent # Everything that comes from here is to do with editing files in external programs applicationEvent(name, "files", **kw) except ImportError: pass
def tryApplicationEvent(self, event, method): if isinstance(event.getSource(), swing.JButton) and event.getActionCommand() is not None and \ event.getActionCommand().startswith("ApplicationEvent"): appEventName = event.getActionCommand().replace("ApplicationEvent", "").lstrip() applicationEvent(appEventName, delayLevel=PhysicalEventManager.getAppEventDelayLevel()) else: method(event, self)
def createStoryTextAppEvent(text): try: import storytext storytext.applicationEvent(text) except AttributeError: pass except ImportError: pass
def runCheck(self, dataMethod, initial): data = dataMethod() if (data is None or data == self.latestData) and not self.loadingFromEmpty(): return True self.latestData = data if initial: self.connect("current-folder-changed", self.currentFolderChanged, dataMethod) applicationEvent("file chooser to read file system", "filechooser") self.checkHandler = None return False
def addApplicationEvent(self, event): message = event.getApplicationEventMessage() self.allEvents.append(message) applicationEvent(message, delayLevel=self.getAppEventDelayLevel())
def completed(self, e): newText = self.getUrlOrText() if newText != self.urlOrText: applicationEvent(self.widget.getNameForAppEvent() + " to finish loading") self.urlOrText = newText
def handleEvent(listenerSelf, e): applicationEvent(e.text)
def setComplete(self): applicationEvent("completion of " + self.nonSystemEventName) self.nonSystemEventName = None
def _operation_finish(self): storytext.applicationEvent('data to be loaded') self.label_out["text"] = self._calc()