[weboorrents] cleaning get_object

This commit is contained in:
Julien Veyssier 2013-03-10 00:03:04 +01:00
commit e8a788cb00
3 changed files with 8 additions and 13 deletions

View file

@ -54,7 +54,7 @@ class TorrentInfoFormatter(IFormatter):
for f in obj.files:
result += ' * %s\n' % f
result += '\n%sDescription%s\n' % (self.BOLD, self.NC)
result += obj.description
result += '%s'%obj.description
return result
@ -95,14 +95,7 @@ class Weboorrents(ReplApplication):
Get information about a torrent.
"""
# Following commented line could be better
#torrent = self.get_object(id, 'get_torrent', ('description','files'))
torrent = None
_id, backend = self.parse_id(id)
for _backend, result in self.do('get_torrent', _id, backends=backend, caps=ICapTorrent):
if result:
backend = _backend
torrent = result
torrent = self.get_object(id, 'get_torrent', ('description','files'))
if not torrent:
print >>sys.stderr, 'Torrent not found: %s' % id
return 3