From 6243a60f681f294171a539f1b37b2fae33840ac4 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 8 May 2011 11:38:15 +0200 Subject: [PATCH] check if there are files before display them --- weboob/applications/weboorrents/weboorrents.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weboob/applications/weboorrents/weboorrents.py b/weboob/applications/weboorrents/weboorrents.py index a2741e89..41199ec0 100644 --- a/weboob/applications/weboorrents/weboorrents.py +++ b/weboob/applications/weboorrents/weboorrents.py @@ -49,9 +49,10 @@ class TorrentInfoFormatter(IFormatter): result += 'Seeders: %s\n' % item['seeders'] result += 'Leechers: %s\n' % item['leechers'] result += 'URL: %s\n' % item['url'] - result += '\n%sFiles%s\n' % (self.BOLD, self.NC) - for f in item['files']: - result += ' * %s\n' % f + if item['files']: + result += '\n%sFiles%s\n' % (self.BOLD, self.NC) + for f in item['files']: + result += ' * %s\n' % f result += '\n%sDescription%s\n' % (self.BOLD, self.NC) result += item['description'] return result