summaryrefslogtreecommitdiffstats
path: root/pyLoadCli.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-16 17:29:36 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-16 17:29:36 +0200
commitcbe4d60d401e4f2cedc38efb375ae38b40fb0c89 (patch)
treefb8cb7befb09b55d738ab483025f627eb3f0059d /pyLoadCli.py
parentfixed little bugs (diff)
downloadpyload-cbe4d60d401e4f2cedc38efb375ae38b40fb0c89.tar.xz
reconnect-, uploaded.to fix
Diffstat (limited to 'pyLoadCli.py')
-rwxr-xr-xpyLoadCli.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py
index 5f030f927..07ac55e5e 100755
--- a/pyLoadCli.py
+++ b/pyLoadCli.py
@@ -103,7 +103,7 @@ class pyLoadCli:
speed += download['speed']
self.println(line, cyan(download["name"]))
line += 1
- self.println(line, blue("[") + yellow(z * "#" + (25-z) * " ") + blue("] ") + green(str(percent) + "%") + " Speed: " + green(str(int(download['speed'])) + " kb/s") + " Size: "+ green(self.format_size(download['size'])) + " Finished in: " + green(self.format_time(download['eta'])) + " ID: " + green(str(download['id'])))
+ self.println(line, blue("[") + yellow(z * "#" + (25-z) * " ") + blue("] ") + green(str(percent) + "%") + " Speed: " + green(str(int(download['speed'])) + " kb/s") + " Size: " + green(self.format_size(download['size'])) + " Finished in: " + green(self.format_time(download['eta'])) + " ID: " + green(str(download['id'])))
line += 1
if download["status"] == "waiting":
self.println(line, cyan(download["name"]))
@@ -315,21 +315,29 @@ def white(string):
if __name__ == "__main__":
- if len(sys.argv) == 2 and sys.argv[1] == "-local":
- config = ConfigParser.SafeConfigParser()
- config.read(os.path.abspath(__file__).replace("pyLoadCli.py","")+'config')
+ if len(sys.argv) == 2:
+
+ shortOptions = 'l'
+ longOptions = ['local']
+
+ opts, extraparams = __import__("getopt").getopt(sys.argv[1:], shortOptions, longOptions)
+ for option, params in opts:
+ if option in ("-l", "--local"):
+ config = ConfigParser.SafeConfigParser()
+ config.read(os.path.abspath(__file__).replace("pyLoadCli.py", "") + 'config')
+
+ address = "127.0.0.1"
+ port = config.get("remote", "port")
+ password = config.get("remote", "remotepassword")
- address = "127.0.0.1"
- port = config.get("remote", "port")
- password = config.get("remote", "remotepassword")
- cli = pyLoadCli(address, port, password)
-
elif len(sys.argv) != 4:
address = raw_input("Adress:")
port = raw_input("Port:")
password = raw_input("Password:")
- cli = pyLoadCli(address, port, password)
else:
- cli = pyLoadCli(* sys.argv[1:])
+ address, port, password = sys.argv[1:4]
+
+
+ cli = pyLoadCli(address, port, password)