def createModel(self): self.model = ResourcesTableModel(self) #self.model.setHeaders(["Full Name", "Creation Date", "Last Update"]) self.model.setHeaders([i18n("Name"), i18n("Date")]) datamanager.findResourcesByType(self.nepomukType, self.model.queryNextReadySlot, self.queryFinishedSlot, self)
def fetchMore(self): # if len(source) == 5: #source = source[:5] if self.parent is None: data = datamanager.findResourcesByType(TMO.Task) self.children.extend(Node(i.genericLabel(), self, self.depth + 1) for i in data) self.hasFinishedLoading = True else: data = datamanager.findResourcesByType(PIMO.Person) self.children.extend(Node(i.genericLabel(), self, self.depth + 1) for i in data) self.hasFinishedLoading = True
def fetchMore(self): # if len(source) == 5: #source = source[:5] if self.parent is None: data = datamanager.findResourcesByType(TMO.Task) self.children.extend( Node(i.genericLabel(), self, self.depth + 1) for i in data) self.hasFinishedLoading = True else: data = datamanager.findResourcesByType(PIMO.Person) self.children.extend( Node(i.genericLabel(), self, self.depth + 1) for i in data) self.hasFinishedLoading = True
def closeEvent(self, event): print "closing..." try: print event except Exception, e: print "An error occurred: '%s.'" % str(e) def setQuery(self, query): self._query = query def query(self): return self._query if __name__ == "__main__": import sys app = QApplication(sys.argv) model = ResourcesTableModel() contacts = datamanager.findResourcesByType(NFO.Website, model.queryNextReadySlot, model.queryFinishedSlot, None) app.exec_()
self.mainWindow.writeEmail(selectedResources) elif key == SET_AS_CONTEXT: resource = Nepomuk.Resource(selectedResources[0]) self.mainWindow.setResourceAsContext(resource) def closeEvent(self, event): print "closing..." try: print event except Exception, e: print "An error occurred: '%s.'" % str(e) def setQuery(self, query): self._query = query def query(self): return self._query if __name__ == "__main__": import sys app = QApplication(sys.argv) model = ResourcesTableModel() contacts = datamanager.findResourcesByType(NFO.Website, model.queryNextReadySlot, model.queryFinishedSlot, None) app.exec_()