diff options
-rw-r--r-- | module/config/core_default.xml | 2 | ||||
-rw-r--r-- | module/gui/Collector.py | 2 | ||||
-rwxr-xr-x | module/network/Request.py | 44 | ||||
-rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 3 | ||||
-rw-r--r-- | pyLoadCore.py | 43 | ||||
-rwxr-xr-x | pyLoadGui.py | 24 |
6 files changed, 59 insertions, 59 deletions
diff --git a/module/config/core_default.xml b/module/config/core_default.xml index e21576ead..8223768ec 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -13,7 +13,7 @@ </ssl> <webinterface name="Webinterface"> <activated type="bool" name="Activated">True</activated> - <server type="builtin;lighttpd;nginx;fastcgi" name="Server">builtin</server> + <server type="str" input="builtin;lighttpd;nginx;fastcgi" name="Server">builtin</server> <https type="bool" name="Use HTTPS">False</https> <host type="ip" name="IP">0.0.0.0</host> <port type="int" name="Port">8001</port> diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 6ec0977d6..6fce9d49e 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -173,7 +173,7 @@ class PackageCollector(QObject): item = newChild item.setData(0, Qt.DisplayRole, QVariant(item.getFileData()["filename"])) item.setData(0, Qt.UserRole, QVariant(cid)) - item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) + item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled) def setPackData(self, data): self._data = data diff --git a/module/network/Request.py b/module/network/Request.py index b47ef4206..22779db6f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -1,10 +1,25 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - - """ -authored by: RaNaN, Spoob + 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/>. + + @author: spoob + @author: RaNaN + @author: mkaay + @version: v0.3.2 """ + import base64 import cookielib from gzip import GzipFile @@ -20,16 +35,6 @@ except: import urllib2 from Keepalive import HTTPHandler - -""" - handles all outgoing HTTP-Requests of the Server - Usage: create Request Instance - use retrieveURL and call it with a url at least - additionaly you can firstly pass the get and secondly the post data in form of a dictonary - when the last argument is true the handler simulate a http referer with the last called url. - retrieveUrl returns response as string - -""" class AbortDownload(Exception): pass @@ -475,6 +480,19 @@ class Request: file_name = temp_name return file_name +def getURL(url): + """ + currently used for update check + """ + req = Request() + c = req.load(url) + if req.curl: + try: + req.pycurl.close() + except: + pass + return c + if __name__ == "__main__": import doctest doctest.testmod() diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 840f62268..be563ef07 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -117,7 +117,8 @@ class RapidshareCom(Plugin): premkbleft = int(fields[18].split("=")[1]) if premkbleft < int(self.api_data["size"][0:-3]): self.logger.info(_("Rapidshare: Not enough traffic left")) - self.config["premium"] = False + #self.config["premium"] = False + self.props["premkbleft"] = 0 else: self.props["premkbleft"] = premkbleft diff --git a/pyLoadCore.py b/pyLoadCore.py index 7bd42c906..ca91187d9 100644 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -20,9 +20,9 @@ @author: mkaay @version: v0.3.2 """ + CURRENT_VERSION = '0.3.2' -from getopt import GetoptError from getopt import getopt import gettext from glob import glob @@ -43,10 +43,10 @@ from os.path import isabs from os.path import join from re import sub import subprocess -import sys from sys import argv from sys import executable from sys import exit +import sys from sys import path from sys import stdout from sys import version_info @@ -61,7 +61,7 @@ from module.HookManager import HookManager from module.PullEvents import PullManager from module.XMLConfigParser import XMLConfigParser from module.file_list import File_List -from module.network.Request import Request +from module.network.Request import getURL import module.remote.SecureXMLRPCServer as Server from module.thread_list import Thread_List from module.web.ServerThread import WebServer @@ -74,40 +74,21 @@ class Core(object): self.arg_links = [] if len(argv) > 1: try: - options, args = getopt(argv[1:], 'vca:hd', ["version", "clear", "add=", "help", "debug"]) + options, arguments = getopt(argv[1:], 'vcl:d') for option, argument in options: - if option in ("-v", "--version"): + if option == "-v": print "pyLoad", CURRENT_VERSION exit() - elif option in ("-c", "--clear"): + elif option == "-c": remove(join("module", "links.pkl")) print "Removed Linklist" - elif option in ("-a", "--add"): + elif option == "-l": self.arg_links.append(argument) print "Added %s" % argument - elif option in ("-h", "--help"): - self.print_help() - exit() - elif option in ("-d", "--debug"): + elif option == "-d": self.doDebug = True - except GetoptError: + except: print 'Unknown Argument(s) "%s"' % " ".join(argv[1:]) - self.print_help() - exit() - - def print_help(self): - print "" - print "pyload %s Copyright (c) 2008-2010 the pyLoad Team" % CURRENT_VERSION - print "" - print "Usage: [python] pyLoadCore.py [options]" - print "" - print "<Options>" - print " -v, --version", " " * 4, "Print version to terminal" - print " -c, --clear", " " * 6, "Delete the saved linklist" - print " -a, --add=<list>", " " * 1, "Add the specified links" - print " -d, --debug", " " * 6, "Enable debug mode" - print " -h, --help", " " * 7, "Display this help screen" - print "" def toggle_pause(self): if self.thread_list.pause: @@ -374,7 +355,7 @@ class Core(object): def check_update(self): try: if self.config['updates']['search_updates']: - version_check = Request().load("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,)) + version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) if version_check == "": self.logger.info(_("No Updates for pyLoad")) return False @@ -392,9 +373,9 @@ class Core(object): try: if self.config['updates']['search_updates']: if self.core.config['updates']['install_updates']: - version_check = Request().load("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION,)) + version_check = getURL("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION, )) else: - version_check = Request().load("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,)) + version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) if version_check == "": return False else: diff --git a/pyLoadGui.py b/pyLoadGui.py index 0287faf14..045aeb1a4 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -199,18 +199,18 @@ class main(QObject): view.takeTopLevelItem(row) def dragEvent(klass, event): view = event.source() - dragOkay = False - items = view.selectedItems() - for item in items: - if hasattr(item, "_data"): - if item._data["id"] == "fixed" or item.parent()._data["id"] == "fixed": - dragOkay = True - else: - dragOkay = True - if dragOkay: - event.accept() - else: - event.ignore() + #dragOkay = False + #items = view.selectedItems() + #for item in items: + # if hasattr(item, "_data"): + # if item._data["id"] == "fixed" or item.parent()._data["id"] == "fixed": + # dragOkay = True + # else: + # dragOkay = True + #if dragOkay: + event.accept() + #else: + # event.ignore() view.dropEvent = dropEvent view.dragEnterEvent = dragEvent view.setDragEnabled(True) |