def rename(self): ref = self.eservice if ref and self.data: path = ref.getPath() if path and os.path.exists(path): from SeriesPluginRenamer import rename if rename(path, self.name, self.short, self.data) is True: self["key_red"].setText("") self.redButtonFunction = None self.session.open( MessageBox, _("Successfully renamed"), MessageBox.TYPE_INFO ) else: self.session.open( MessageBox, _("Renaming failed"), MessageBox.TYPE_INFO )
def keyRename(self): log.debug("keyRename") ref = self.eservice if ref and self.data: path = ref.getPath() if path and os.path.exists(path): from SeriesPluginRenamer import rename if rename(path, self.name, self.short, self.data) is True: self["key_red"].setText("") self.redButtonFunction = None self.session.open( MessageBox, _("Successfully renamed"), MessageBox.TYPE_INFO ) else: self.session.open( MessageBox, _("Renaming failed"), MessageBox.TYPE_ERROR )