diff options
Diffstat (limited to 'pyload/cli')
-rw-r--r-- | pyload/cli/Cli.py | 7 | ||||
-rw-r--r-- | pyload/cli/Handler.py | 1 | ||||
-rw-r--r-- | pyload/cli/ManageFiles.py | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/pyload/cli/Cli.py b/pyload/cli/Cli.py index 84725b625..cd3252220 100644 --- a/pyload/cli/Cli.py +++ b/pyload/cli/Cli.py @@ -214,7 +214,7 @@ class Cli(object): # clear old output if line < self.lastLowestLine: - for i in range(line + 1, self.lastLowestLine + 1): + for i in xrange(line + 1, self.lastLowestLine + 1): println(i, "") self.lastLowestLine = line @@ -321,9 +321,8 @@ class Cli(object): print _("File does not exists.") return - f = open(join(owd, path), "rb") - content = f.read() - f.close() + with open(join(owd, path), "rb") as f: + content = f.read() rid = self.client.checkOnlineStatusContainer([], basename(f.name), content).rid self.printOnlineCheck(self.client, rid) diff --git a/pyload/cli/Handler.py b/pyload/cli/Handler.py index 444d7f6d0..33e5dd8e6 100644 --- a/pyload/cli/Handler.py +++ b/pyload/cli/Handler.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # @author: RaNaN - class Handler(object): def __init__(self, cli): diff --git a/pyload/cli/ManageFiles.py b/pyload/cli/ManageFiles.py index c010895c5..2e7f725dd 100644 --- a/pyload/cli/ManageFiles.py +++ b/pyload/cli/ManageFiles.py @@ -113,7 +113,7 @@ class ManageFiles(Handler): i += 1 except Exception: pass - for _i in range(5 - i): + for _i in xrange(5 - i): println(line, "") line += 1 else: @@ -128,7 +128,7 @@ class ManageFiles(Handler): i += 1 except Exception, e: pass - for _i in range(5 - i): + for _i in xrange(5 - i): println(line, "") line += 1 @@ -168,7 +168,7 @@ class ManageFiles(Handler): inp = inp.strip() if "-" in inp: l, _, h = inp.partition("-") - r = range(int(l), int(h) + 1) + r = xrange(int(l), int(h) + 1) if package: return [p.pid for p in self.cache if p.pid in r] |