def _handle_new_item(self, data, type): """ Add a new item to the store Print it to stdout if needed """ item = make_item(data, type) self.store.append(item) self.emit("item-added", item)
def try_get_data(self): """ Send get_data method to another instance and try to get its data """ from shelfitem import make_item if not self.dbus_connection: # dbus is not available or the requested name # is simply not there name = self.identifier and self.identifier or "Default" print_error("Shelf %s not found" % name) self.get_dbus_names() return False datas, types = self.dbus_connection.get_interface().get_data() writer = self.make_writer() for data, type in zip(datas, types): writer.print_item(None, make_item(data, type)) return True