summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-08-14 13:40:43 +0200
committerGravatar spoob <spoob@gmx.de> 2009-08-14 13:40:43 +0200
commit8a5ea9dbbc4a223f42eb900a8ba8a3b69a4dd961 (patch)
treee7d7b089530f08abea69c40d3835fbaa1005cf1d
parentlittle fixes (diff)
downloadpyload-8a5ea9dbbc4a223f42eb900a8ba8a3b69a4dd961.tar.xz
added --url and --list params
-rwxr-xr-x[-rw-r--r--]pyLoadCli.py0
-rwxr-xr-x[-rw-r--r--]pyLoadCore.py23
-rwxr-xr-x[-rw-r--r--]pyLoadUpdater.py0
3 files changed, 19 insertions, 4 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py
index 5f030f927..5f030f927 100644..100755
--- a/pyLoadCli.py
+++ b/pyLoadCli.py
diff --git a/pyLoadCore.py b/pyLoadCore.py
index bc17479d8..9c9ff0eb8 100644..100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -303,11 +303,28 @@ class Core(object):
def start(self):
""" starts the machine
"""
+ if len(argv) > 1:
+ shortOptions = 'pu:l:'
+ longOptions = ['print', 'url=', 'list=']
+
+ opts, extraparams = __import__("getopt").getopt(argv[1:], shortOptions, longOptions)
+ for option,params in opts:
+ if option in ("-p","--print"):
+ print "Print test output"
+ self.print_test_status = True
+ elif option in ("-u", "--url"):
+ self.logger.info("Add url: " + params)
+ self.add_links([params])
+ elif option in ("-l", "--list"):
+ list = open(params, 'r').readlines()
+ self.add_links(link)
+ self.logger.info("Add list:" + params)
+
self.read_links()
while True:
#self.thread_list.status()
- if print_test_status:
+ if self.print_test_status:
self._test_print_status()
self.server_send_status()
sleep(2)
@@ -318,7 +335,6 @@ class Core(object):
def _test_print_status(self):
if self.thread_list.py_downloading:
-
for pyfile in self.thread_list.py_downloading:
if pyfile.status.type == 'downloading':
print pyfile.status.filename + ": speed is", int(pyfile.status.get_speed()), "kb/s"
@@ -331,7 +347,6 @@ if __name__ == "__main__":
if argv[1] == "-v":
print "pyLoad", CURRENT_VERSION
exit()
- elif argv[1] == "-p":
- print_test_status = True
+
testLoader = Core()
testLoader.start()
diff --git a/pyLoadUpdater.py b/pyLoadUpdater.py
index e6395a080..e6395a080 100644..100755
--- a/pyLoadUpdater.py
+++ b/pyLoadUpdater.py