FILENAME argument is optional for command 'getfile' (closes #683)
This commit is contained in:
parent
3b87d4aaf8
commit
c74216ccf8
1 changed files with 5 additions and 2 deletions
|
|
@ -127,16 +127,19 @@ class Weboorrents(ReplApplication):
|
||||||
|
|
||||||
def do_getfile(self, line):
|
def do_getfile(self, line):
|
||||||
"""
|
"""
|
||||||
getfile ID FILENAME
|
getfile ID [FILENAME]
|
||||||
|
|
||||||
Get the .torrent file.
|
Get the .torrent file.
|
||||||
FILENAME is where to write the file. If FILENAME is '-',
|
FILENAME is where to write the file. If FILENAME is '-',
|
||||||
the file is written to stdout.
|
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)
|
_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):
|
for backend, buf in self.do('get_torrent_file', _id, backends=backend_name):
|
||||||
if buf:
|
if buf:
|
||||||
if dest == '-':
|
if dest == '-':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue