From c74216ccf80a750c20f631d9aba435de4413f2af Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 5 Jul 2011 16:27:06 +0200 Subject: [PATCH] FILENAME argument is optional for command 'getfile' (closes #683) --- weboob/applications/weboorrents/weboorrents.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weboob/applications/weboorrents/weboorrents.py b/weboob/applications/weboorrents/weboorrents.py index b1f4e54c..3c748dcf 100644 --- a/weboob/applications/weboorrents/weboorrents.py +++ b/weboob/applications/weboorrents/weboorrents.py @@ -127,16 +127,19 @@ class Weboorrents(ReplApplication): def do_getfile(self, line): """ - getfile ID FILENAME + getfile ID [FILENAME] Get the .torrent file. FILENAME is where to write the file. If FILENAME is '-', the file is written to stdout. """ - id, dest = self.parse_command_args(line, 2, 2) + id, dest = self.parse_command_args(line, 2, 1) _id, backend_name = self.parse_id(id) + if dest is None: + dest = '%s.torrent' % _id + for backend, buf in self.do('get_torrent_file', _id, backends=backend_name): if buf: if dest == '-':