def parse_id(self, id): if self.interactive: try: account = self.accounts[int(id) - 1] except (IndexError,ValueError): pass else: return account.id, account.backend return ReplApplication.parse_id(self, id)
def parse_id(self, id): if self.interactive: try: torrent = self.torrents[int(id) - 1] except (IndexError,ValueError): pass else: id = '%s@%s' % (torrent.id, torrent.backend) return ReplApplication.parse_id(self, id)