Commit 3b1637d1 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

rboorrent-download: PEP8 fixes

parent 327ae3a6
......@@ -22,6 +22,7 @@ from __future__ import print_function
import sys
class RboorrentDownload(object):
def __init__(self, _id, no_tracker):
self.id, self.backend_name = _id.split("@")
......@@ -43,7 +44,7 @@ class RboorrentDownload(object):
with open(dest, 'w') as f:
f.write(buf)
except IOError as e:
print('Unable to write "%s": %s' % (dest, e.message))
print('Unable to write "%s": %s' % (dest, e.message))
def write_torrent(self, torrent):
dest = "%s-%s.torrent" % (torrent.id, torrent.name)
......@@ -68,12 +69,14 @@ class RboorrentDownload(object):
except HTTPNotFound:
print("Could not find %s@%s" % (self.id, self.backend_name))
def usage():
prog_name = sys.argv[0].split("/")[-1]
print("Usage: %s [-b] HASH@MODULE" % prog_name)
print(" -b: don't include tracker URLs in the magnet link")
sys.exit()
def parsed_args():
if len(sys.argv) == 3 and sys.argv[1] == "-b":
return (sys.argv[2], True)
......@@ -85,6 +88,7 @@ def parsed_args():
else:
usage()
if __name__ == "__main__":
args = parsed_args()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment