diff options
author | spoob <spoob@gmx.de> | 2009-05-31 18:23:42 +0200 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2009-05-31 18:23:42 +0200 |
commit | 49d41f96c4ab61850ff5fab1f21f95886975ff95 (patch) | |
tree | 4ad19319ab212c8471386aee54a2205791e45b3b | |
parent | pyload server starts when gui starts (diff) | |
download | pyload-49d41f96c4ab61850ff5fab1f21f95886975ff95.tar.xz |
download plugin for xup.in added, download works with post data
-rw-r--r-- | Core.py | 2 | ||||
-rw-r--r-- | config | 2 | ||||
-rwxr-xr-x | module/network/Request.py | 11 | ||||
-rw-r--r-- | pluginconfig | 2 | ||||
-rwxr-xr-x | pyMainGui.py | 22 |
5 files changed, 16 insertions, 23 deletions
@@ -145,7 +145,7 @@ class Core(object): """ newst_version = urllib2.urlopen("http://pyload.nady.biz/files/version.txt").readline().strip() if CURRENT_VERSION < newst_version: - print _("new update %s on pyload.de.rw") % newst_version #newer version out + print _("new update %s on pyload.org") % newst_version #newer version out elif CURRENT_VERSION == newst_version: print _("newst version %s in use:") % CURRENT_VERSION #using newst version else: @@ -1,6 +1,6 @@ [general] #use de or en -language: de +language: en download_folder = Downloads link_file = links.txt useReconnect = False diff --git a/module/network/Request.py b/module/network/Request.py index 86449a4f2..25eccab87 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -51,7 +51,6 @@ class Request: ("Accept-Encoding","gzip,deflate"), ("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"), ("Accept-Charset","ISO-8859-1,utf-8;q=0.7,*;q=0.7")] - def load(self, url, get = {}, post = {}, ref = True): @@ -90,11 +89,17 @@ class Request: #def download(url, filename, reporthook = None, data = None): #default von urlretrieve auch None? # return self.downloader.urlretrieve(url, filename, reporthook, data) - def download(self, url, filename): + def download(self, url, filename, post = {}): + + if post: + post = urllib.urlencode(post) + else: + post = None + if not self.dl: self.dl = True file = open(filename, 'wb') - req = urllib2.Request(url) + req = urllib2.Request(url, post) conn = self.downloader.open(req) self.dl_size = int(conn.headers["content-length"]) self.dl_arrived = 0 diff --git a/pluginconfig b/pluginconfig index 4a886bcfb..d24101d93 100644 --- a/pluginconfig +++ b/pluginconfig @@ -1,4 +1,4 @@ [RapidshareCom] premium = False username = user -password = pass +password = pass diff --git a/pyMainGui.py b/pyMainGui.py index 10903433c..ed7dfb2c2 100755 --- a/pyMainGui.py +++ b/pyMainGui.py @@ -25,10 +25,6 @@ from os.path import dirname import wx import wx.lib.sized_controls as sized_control from module.remote.ClientSocket import ClientSocket -from Core import Core -#from module.Py_Load_File import PyLoadFile -from module.remote.SocketServer import ServerThread -#from module.thread_list import Thread_List class _Download_Dialog(sized_control.SizedDialog): def __init__(self, parent, id): @@ -74,14 +70,7 @@ class Pyload_Main_Gui(wx.Frame): wx.Frame.__init__(self, parent, id, title, size=(910, 500)) app_path = dirname(abspath(__file__)) + sep - # Core - testLoader = Core() - if testLoader.config['remote_activated']: - print _("Server Mode") - server = ServerThread(testLoader) - server.start() - - # socket + # socket self.socket = ClientSocket(self) self.socket.connect(('localhost', 7272)) self.socket.sendall("nonsense\n") @@ -127,8 +116,7 @@ class Pyload_Main_Gui(wx.Frame): adddownload = _Download_Dialog(None, -1) result = adddownload.ShowModal() adddownload.Destroy() - -if __name__ == "__main__": - app = wx.App() - Pyload_Main_Gui(None,-1) - app.MainLoop() + +app = wx.App() +Pyload_Main_Gui(None,-1) +app.MainLoop() |