diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-14 00:07:43 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-14 00:07:43 +0200 |
commit | 9db8236ef598e4dff7f9be2d7558b80ce1330c97 (patch) | |
tree | 208e0f928f042a5db56a949c9e80bbd5e3b879c9 /pyLoadCli.py | |
parent | every number of to download videos work with youtube channel, fixed #7 (diff) | |
download | pyload-9db8236ef598e4dff7f9be2d7558b80ce1330c97.tar.xz |
new naming convention, cli structur
Diffstat (limited to 'pyLoadCli.py')
-rw-r--r-- | pyLoadCli.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/pyLoadCli.py b/pyLoadCli.py new file mode 100644 index 000000000..d5c2d9f60 --- /dev/null +++ b/pyLoadCli.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +#Copyright (C) 2009 RaNaN, Willnix +# +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, +#or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +### +import time +import thread +import os +import sys +from module.remote.ClientSocket import SocketThread + +class pyLoadCli: + def __init__(self, adress, port, pw): + thread = SocketThread(adress, int(port), pw, self) + self.start() + + def start(self): + while True: + inp = raw_input() + print inp[-1] + + def data_arrived(self, obj): + """Handle incoming data""" + if obj.command == "update": + print str(obj.data) + + +if __name__ == "__main__": + if len(sys.argv) != 4: + address = raw_input("Adress:") + port = raw_input("Port:") + pw = raw_input("Password:") + cli = pyLoadCli(adress,port,pw) + else: + cli = pyLoadCli(*sys.argv[1:]) + + |