diff options
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/manager/Account.py | 2 | ||||
-rw-r--r-- | pyload/manager/Addon.py | 17 | ||||
-rw-r--r-- | pyload/manager/Plugin.py | 4 | ||||
-rw-r--r-- | pyload/network/JsEngine.py | 12 | ||||
-rw-r--r-- | pyload/plugin/Account.py | 6 | ||||
-rw-r--r-- | pyload/plugin/Addon.py | 4 | ||||
-rw-r--r-- | pyload/plugin/OCR.py | 6 | ||||
-rw-r--r-- | pyload/plugin/Plugin.py | 39 | ||||
-rw-r--r-- | pyload/plugin/account/OboomCom.py | 14 | ||||
-rw-r--r-- | pyload/plugin/account/SmoozedCom.py | 14 | ||||
-rw-r--r-- | pyload/plugin/addon/DeleteFinished.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/ExtractArchive.py | 4 | ||||
-rw-r--r-- | pyload/plugin/addon/MergeFiles.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/RestartFailed.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/UpdateManager.py | 8 | ||||
-rw-r--r-- | pyload/plugin/internal/MultiHook.py | 8 | ||||
-rw-r--r-- | pyload/plugin/internal/MultiHoster.py | 4 | ||||
-rw-r--r-- | pyload/plugin/internal/SimpleHoster.py | 2 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSCrypter.py | 2 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSHoster.py | 2 | ||||
-rw-r--r-- | pyload/utils/__init__.py | 1 | ||||
-rw-r--r-- | pyload/webui/app/pyloadweb.py | 2 | ||||
-rw-r--r-- | pyload/webui/app/utils.py | 2 |
23 files changed, 93 insertions, 66 deletions
diff --git a/pyload/manager/Account.py b/pyload/manager/Account.py index 2631e1c7d..12fc970c2 100644 --- a/pyload/manager/Account.py +++ b/pyload/manager/Account.py @@ -176,7 +176,7 @@ class AccountManager(object): if self.accounts[p]: p = self.getAccountPlugin(p) if p: - data[p.__name] = p.getAllAccounts(force) + data[p.__class__.__name__] = p.getAllAccounts(force) else: #@NOTE: When an account has been skipped, p is None data[p] = [] else: diff --git a/pyload/manager/Addon.py b/pyload/manager/Addon.py index 164068634..6a9c59c45 100644 --- a/pyload/manager/Addon.py +++ b/pyload/manager/Addon.py @@ -71,7 +71,7 @@ class AddonManager(object): try: return func(*args) except Exception, e: - args[0].log.error(_("Error executing addon: %s") % e) + args[0].core.log.error(_("Error executing addon: %s") % e) if args[0].core.debug: traceback.print_exc() @@ -105,7 +105,6 @@ class AddonManager(object): for pluginname in self.core.pluginManager.addonPlugins: try: - # hookClass = getattr(plugin, plugin.__name) if self.core.config.getPlugin(pluginname, "activated"): pluginClass = self.core.pluginManager.loadClass("addon", pluginname) if not pluginClass: @@ -113,15 +112,15 @@ class AddonManager(object): plugin = pluginClass(self.core, self) plugins.append(plugin) - self.pluginMap[pluginClass.__name] = plugin + self.pluginMap[pluginClass.__name__] = plugin if plugin.isActivated(): - active.append(pluginClass.__name) + active.append(pluginClass.__name__) else: deactive.append(pluginname) except Exception: self.core.log.warning(_("Failed activating %(name)s") % {"name": pluginname}) - if self.core.debug: + if self.core.debug or True: traceback.print_exc() self.core.log.info(_("Activated addons: %s") % ", ".join(sorted(active))) @@ -141,7 +140,7 @@ class AddonManager(object): def activateAddon(self, pluginname): # check if already loaded for inst in self.plugins: - if inst.__name == pluginname: + if inst.__class__.__name__ == pluginname: return pluginClass = self.core.pluginManager.loadClass("addon", pluginname) @@ -153,14 +152,14 @@ class AddonManager(object): addon = pluginClass(self.core, self) self.plugins.append(addon) - self.pluginMap[pluginClass.__name] = addon + self.pluginMap[pluginClass.__name__] = addon addon.activate() def deactivateAddon(self, pluginname): for plugin in self.plugins: - if plugin.__name == pluginname: + if plugin.__class__.__name__ == pluginname: addon = plugin break else: @@ -174,7 +173,7 @@ class AddonManager(object): self.core.log.debug("Removed callback: %s" % self.core.scheduler.removeJob(addon.cb)) self.plugins.remove(addon) - del self.pluginMap[addon.__name] + del self.pluginMap[addon.__class__.__name__] @try_catch diff --git a/pyload/manager/Plugin.py b/pyload/manager/Plugin.py index 72fabb33a..99778c3f3 100644 --- a/pyload/manager/Plugin.py +++ b/pyload/manager/Plugin.py @@ -60,7 +60,9 @@ class PluginManager(object): self.plugins[type] = self.parse(type) setattr(self, "%sPlugins" % type, self.plugins[type]) - self.plugins['addon'] = self.addonPlugins.update(self.hookPlugins) + # ???????? i don't understand this + # self.plugins['addon'] = self.addonPlugins.update(self.hookPlugins) + # ???????? self.core.log.debug("Created index of plugins") diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index ed7d49d27..c64e8c490 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -46,7 +46,7 @@ class JsEngine(object): elif isinstance(engine, basestring): engine_name = engine.lower() for E in ENGINES: - if E.__name == engine_name: #: doesn't check if E(NGINE) is available, just convert string to class + if E._name == engine_name: #: doesn't check if E(NGINE) is available, just convert string to class JSE = E break else: @@ -88,14 +88,14 @@ class JsEngine(object): if self.core.config.get("general", "debug"): if err: - self.core.log.debug(JSE.__name + ":", err) + self.core.log.debug(JSE._name + ":", err) engines = self.find() engines.remove(JSE) for E in engines: out, err = E.eval(script) res = err or out - self.core.log.debug(E.__name + ":", res) + self.core.log.debug(E._name + ":", res) results.append(res) if len(results) > 1 and len(uniqify(results)) > 1: @@ -107,7 +107,7 @@ class JsEngine(object): class AbstractEngine(object): """ JSE base class """ - __name = "" + _name = "" def __init__(self, force=False): @@ -139,7 +139,7 @@ class AbstractEngine(object): def _eval(self, args): if not self.available: - return None, "JS Engine \"%s\" not found" % self.__name + return None, "JS Engine \"%s\" not found" % self._name try: p = subprocess.Popen(args, @@ -162,7 +162,7 @@ class Pyv8Engine(AbstractEngine): def eval(self, script): if not self.available: - return None, "JS Engine \"%s\" not found" % self.__name + return None, "JS Engine \"%s\" not found" % self._name try: rt = PyV8.JSContext() diff --git a/pyload/plugin/Account.py b/pyload/plugin/Account.py index b14615d3a..6a3eddc5b 100644 --- a/pyload/plugin/Account.py +++ b/pyload/plugin/Account.py @@ -197,7 +197,7 @@ class Account(Base): "maxtraffic" : None, "premium" : None, "timestamp" : 0, #: time this info was retrieved - "type" : self.__name} + "type" : self.__class__.__name__} def getAllAccounts(self, force=False): @@ -210,7 +210,7 @@ class Account(Base): if not user: return None - req = self.core.requestFactory.getRequest(self.__name, user) + req = self.core.requestFactory.getRequest(self.__class__.__name__, user) return req @@ -220,7 +220,7 @@ class Account(Base): if not user: return None - cj = self.core.requestFactory.getCookieJar(self.__name, user) + cj = self.core.requestFactory.getCookieJar(self.__class__.__name__, user) return cj diff --git a/pyload/plugin/Addon.py b/pyload/plugin/Addon.py index 14b5ee2a5..d33cdd400 100644 --- a/pyload/plugin/Addon.py +++ b/pyload/plugin/Addon.py @@ -98,7 +98,7 @@ class Addon(Base): def __repr__(self): - return "<Addon %s>" % self.__name + return "<Addon %s>" % self.__class__.__name__ def setup(self): @@ -117,7 +117,7 @@ class Addon(Base): def isActivated(self): """ checks if addon is activated""" - return self.core.config.getPlugin(self.__name, "activated") + return self.core.config.getPlugin(self.__class__.__name__, "activated") # Event methods - overwrite these if needed diff --git a/pyload/plugin/OCR.py b/pyload/plugin/OCR.py index 109dd1843..01ba6d534 100644 --- a/pyload/plugin/OCR.py +++ b/pyload/plugin/OCR.py @@ -60,11 +60,11 @@ class OCR(Base): def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True): #tmpTif = tempfile.NamedTemporaryFile(suffix=".tif") try: - tmpTif = open(fs_join("tmp", "tmpTif_%s.tif" % self.__name), "wb") + tmpTif = open(fs_join("tmp", "tmpTif_%s.tif" % self.__class__.__name__), "wb") tmpTif.close() #tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") - tmpTxt = open(fs_join("tmp", "tmpTxt_%s.txt" % self.__name), "wb") + tmpTxt = open(fs_join("tmp", "tmpTxt_%s.txt" % self.__class__.__name__), "wb") tmpTxt.close() except IOError, e: @@ -83,7 +83,7 @@ class OCR(Base): if subset and (digits or lowercase or uppercase): #tmpSub = tempfile.NamedTemporaryFile(suffix=".subset") - with open(fs_join("tmp", "tmpSub_%s.subset" % self.__name), "wb") as tmpSub: + with open(fs_join("tmp", "tmpSub_%s.subset" % self.__class__.__name__), "wb") as tmpSub: tmpSub.write("tessedit_char_whitelist ") if digits: diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py index e136bfc29..1c2091d66 100644 --- a/pyload/plugin/Plugin.py +++ b/pyload/plugin/Plugin.py @@ -6,6 +6,7 @@ from time import time, sleep from random import randint import os +import re from os import remove, makedirs, chmod, stat from os.path import exists, join @@ -18,7 +19,7 @@ from itertools import islice from traceback import print_exc from urlparse import urlparse -from pyload.utils import fs_decode, fs_encode, safe_filename, fs_join +from pyload.utils import fs_decode, fs_encode, safe_filename, fs_join, encode def chunks(iterable, size): @@ -62,7 +63,7 @@ class Base(object): def _log(self, type, args): msg = " | ".join([encode(a).strip() for a in args if a]) logger = getattr(self.core.log, type) - logger("%s: %s" % (self.__name, msg or _("%s MARK" % type.upper()))) + logger("%s: %s" % (self.__class__.__name__, msg or _("%s MARK" % type.upper()))) def logDebug(self, *args): @@ -99,7 +100,7 @@ class Base(object): :param value: :return: """ - self.core.config.setPlugin(self.__name, option, value) + self.core.config.setPlugin(self.__class__.__name__, option, value) #: Deprecated method @@ -114,24 +115,24 @@ class Base(object): :param option: :return: """ - return self.core.config.getPlugin(self.__name, option) + return self.core.config.getPlugin(self.__class__.__name__, option) def setStorage(self, key, value): """ Saves a value persistently to the database """ - self.core.db.setStorage(self.__name, key, value) + self.core.db.setStorage(self.__class__.__name__, key, value) def store(self, key, value): """ same as `setStorage` """ - self.core.db.setStorage(self.__name, key, value) + self.core.db.setStorage(self.__class__.__name__, key, value) def getStorage(self, key=None, default=None): """ Retrieves saved value or dict of all saved entries if key is None """ if key: - return self.core.db.getStorage(self.__name, key) or default - return self.core.db.getStorage(self.__name, key) + return self.core.db.getStorage(self.__class__.__name__, key) or default + return self.core.db.getStorage(self.__class__.__name__, key) def retrieve(self, *args, **kwargs): @@ -141,7 +142,7 @@ class Base(object): def delStorage(self, key): """ Delete entry in db """ - self.core.db.delStorage(self.__name, key) + self.core.db.delStorage(self.__class__.__name__, key) class Plugin(Base): @@ -188,7 +189,7 @@ class Plugin(Base): self.ocr = None #: account handler instance, see :py:class:`Account` - self.account = pyfile.m.core.accountManager.getAccountPlugin(self.__name) + self.account = pyfile.m.core.accountManager.getAccountPlugin(self.__class__.__name__) #: premium status self.premium = False @@ -209,7 +210,7 @@ class Plugin(Base): #: premium status self.premium = self.account.isPremium(self.user) else: - self.req = pyfile.m.core.requestFactory.getRequest(self.__name) + self.req = pyfile.m.core.requestFactory.getRequest(self.__class__.__name__) #: associated pyfile instance, see `PyFile` self.pyfile = pyfile @@ -240,7 +241,7 @@ class Plugin(Base): def __call__(self): - return self.__name + return self.__class__.__name__ def init(self): @@ -277,7 +278,7 @@ class Plugin(Base): def resetAccount(self): """ dont use account and retry download """ self.account = None - self.req = self.core.requestFactory.getRequest(self.__name) + self.req = self.core.requestFactory.getRequest(self.__class__.__name__) self.retry() @@ -451,13 +452,13 @@ class Plugin(Base): id = ("%.2f" % time())[-6:].replace(".", "") - with open(join("tmp", "tmpCaptcha_%s_%s.%s" % (self.__name, id, imgtype)), "wb") as tmpCaptcha: + with open(join("tmp", "tmpCaptcha_%s_%s.%s" % (self.__class__.__name__, id, imgtype)), "wb") as tmpCaptcha: tmpCaptcha.write(img) - has_plugin = self.__name in self.core.pluginManager.ocrPlugins + has_plugin = self.__class__.__name__ in self.core.pluginManager.ocrPlugins if self.core.captcha: - Ocr = self.core.pluginManager.loadClass("ocr", self.__name) + Ocr = self.core.pluginManager.loadClass("ocr", self.__class__.__name__) else: Ocr = None @@ -535,10 +536,10 @@ class Plugin(Base): from inspect import currentframe frame = currentframe() - framefile = fs_join("tmp", self.__name, "%s_line%s.dump.html" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)) + framefile = fs_join("tmp", self.__class__.__name__, "%s_line%s.dump.html" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)) try: - if not exists(join("tmp", self.__name)): - makedirs(join("tmp", self.__name)) + if not exists(join("tmp", self.__class__.__name__)): + makedirs(join("tmp", self.__class__.__name__)) with open(framefile, "wb") as f: del frame #: delete the frame or it wont be cleaned diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py index 7b73c38fa..0712cbc37 100644 --- a/pyload/plugin/account/OboomCom.py +++ b/pyload/plugin/account/OboomCom.py @@ -2,7 +2,19 @@ import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 +except: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from pyload.utils import json_loads from pyload.plugin.Account import Account diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py index 54cd94fbf..ffe7142cf 100644 --- a/pyload/plugin/account/SmoozedCom.py +++ b/pyload/plugin/account/SmoozedCom.py @@ -3,7 +3,19 @@ import hashlib import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 +except: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from pyload.utils import json_loads from pyload.plugin.Account import Account diff --git a/pyload/plugin/addon/DeleteFinished.py b/pyload/plugin/addon/DeleteFinished.py index 2349503f6..7e47a8728 100644 --- a/pyload/plugin/addon/DeleteFinished.py +++ b/pyload/plugin/addon/DeleteFinished.py @@ -52,7 +52,7 @@ class DeleteFinished(Addon): def activate(self): self.info['sleep'] = True # interval = self.getConfig('interval') - # self.pluginConfigChanged(self.__name, 'interval', interval) + # self.pluginConfigChanged(self.__class__.__name__, 'interval', interval) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60 * 60) self.addEvent('packageFinished', self.wakeup) self.initPeriodical() diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index 369be11bb..c5b3b6993 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -173,7 +173,7 @@ class ExtractArchive(Addon): print_exc() if self.extractors: - self.logInfo(_("Activated") + " " + "|".join("%s %s" % (Extractor.__name,Extractor.VERSION) for Extractor in self.extractors)) + self.logInfo(_("Activated") + " " + "|".join("%s %s" % (Extractor.__name__,Extractor.VERSION) for Extractor in self.extractors)) self.extractQueued() #: Resume unfinished extractions else: self.logInfo(_("No Extract plugins activated")) @@ -288,7 +288,7 @@ class ExtractArchive(Addon): for Extractor in self.extractors: targets = Extractor.getTargets(files_ids) if targets: - self.logDebug("Targets for %s: %s" % (Extractor.__name, targets)) + self.logDebug("Targets for %s: %s" % (Extractor.__class__.__name__, targets)) matched = True for fname, fid, fout in targets: diff --git a/pyload/plugin/addon/MergeFiles.py b/pyload/plugin/addon/MergeFiles.py index 87775bea2..a0298052b 100644 --- a/pyload/plugin/addon/MergeFiles.py +++ b/pyload/plugin/addon/MergeFiles.py @@ -46,7 +46,7 @@ class MergeFiles(Addon): for name, file_list in files.iteritems(): self.logInfo(_("Starting merging of"), name) - final_file = open(fs_join(download_folder, name), "wb") + with open(fs_join(download_folder, name), "wb") as final_file: for splitted_file in file_list: self.logDebug("Merging part", splitted_file) diff --git a/pyload/plugin/addon/RestartFailed.py b/pyload/plugin/addon/RestartFailed.py index eaa86ebcb..695ebb154 100644 --- a/pyload/plugin/addon/RestartFailed.py +++ b/pyload/plugin/addon/RestartFailed.py @@ -38,6 +38,6 @@ class RestartFailed(Addon): def activate(self): - # self.pluginConfigChanged(self.__name, "interval", self.getConfig('interval')) + # self.pluginConfigChanged(self.__class__.__name__, "interval", self.getConfig('interval')) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60) self.initPeriodical() diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py index a2b26b618..41a1d7f2c 100644 --- a/pyload/plugin/addon/UpdateManager.py +++ b/pyload/plugin/addon/UpdateManager.py @@ -83,15 +83,15 @@ class UpdateManager(Addon): def autoreloadPlugins(self): """ reload and reindex all modified plugins """ modules = filter( - lambda m: m and (m.__name.startswith("module.plugins.") or - m.__name.startswith("userplugins.")) and - m.__name.count(".") >= 2, sys.modules.itervalues() + lambda m: m and (m.__name__.startswith("module.plugins.") or + m.__name__.startswith("userplugins.")) and + m.__name__.count(".") >= 2, sys.modules.itervalues() ) reloads = [] for m in modules: - root, type, name = m.__name.rsplit(".", 2) + root, type, name = m.__name__.rsplit(".", 2) id = (type, name) if type in self.core.pluginManager.plugins: f = m.__file__.replace(".pyc", ".py") diff --git a/pyload/plugin/internal/MultiHook.py b/pyload/plugin/internal/MultiHook.py index 5e828cd5e..c5fb21db5 100644 --- a/pyload/plugin/internal/MultiHook.py +++ b/pyload/plugin/internal/MultiHook.py @@ -68,16 +68,16 @@ class MultiHook(Hook): def _initPlugin(self): - plugin, type = self.core.pluginManager.findPlugin(self.__name) + plugin, type = self.core.pluginManager.findPlugin(self.__class__.__name__) if not plugin: self.logWarning("Hook plugin will be deactivated due missing plugin reference") self.setConfig('activated', False) else: - self.pluginname = self.__name + self.pluginname = self.__class__.__name__ self.plugintype = type - self.pluginmodule = self.core.pluginManager.loadModule(type, self.__name) - self.pluginclass = getattr(self.pluginmodule, self.__name) + self.pluginmodule = self.core.pluginManager.loadModule(type, self.__class__.__name__) + self.pluginclass = getattr(self.pluginmodule, self.__class__.__name__) def loadAccount(self): diff --git a/pyload/plugin/internal/MultiHoster.py b/pyload/plugin/internal/MultiHoster.py index a38da9bdb..a7e74b2ff 100644 --- a/pyload/plugin/internal/MultiHoster.py +++ b/pyload/plugin/internal/MultiHoster.py @@ -86,8 +86,8 @@ class MultiHoster(SimpleHoster): self.retryFree() elif self.getConfig('revertfailed', True) \ - and "new_module" in self.core.pluginManager.hosterPlugins[self.__name]: - hdict = self.core.pluginManager.hosterPlugins[self.__name] + and "new_module" in self.core.pluginManager.hosterPlugins[self.__class__.__name__]: + hdict = self.core.pluginManager.hosterPlugins[self.__class__.__name__] tmp_module = hdict['new_module'] tmp_name = hdict['new_name'] diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py index d07eca2a1..60f13324f 100644 --- a/pyload/plugin/internal/SimpleHoster.py +++ b/pyload/plugin/internal/SimpleHoster.py @@ -437,7 +437,7 @@ class SimpleHoster(Hoster): set_cookies(self.req.cj, self.COOKIES) if (self.MULTI_HOSTER - and (self.__pattern != self.core.pluginManager.hosterPlugins[self.__name]['pattern'] + and (self.__pattern != self.core.pluginManager.hosterPlugins[self.__class__.__name__]['pattern'] or re.match(self.__pattern, self.pyfile.url) is None)): self.multihost = True return diff --git a/pyload/plugin/internal/XFSCrypter.py b/pyload/plugin/internal/XFSCrypter.py index 44b4ed724..6a3f09e55 100644 --- a/pyload/plugin/internal/XFSCrypter.py +++ b/pyload/plugin/internal/XFSCrypter.py @@ -31,7 +31,7 @@ class XFSCrypter(SimpleCrypter): if self.account: account = self.account else: - account_name = (self.__name + ".py").replace("Folder.py", "").replace(".py", "") + account_name = (self.__class__.__name__ + ".py").replace("Folder.py", "").replace(".py", "") account = self.pyfile.m.core.accountManager.getAccountPlugin(account_name) if account and hasattr(account, "HOSTER_DOMAIN") and account.HOSTER_DOMAIN: diff --git a/pyload/plugin/internal/XFSHoster.py b/pyload/plugin/internal/XFSHoster.py index 05b26bebe..e87b6b0ee 100644 --- a/pyload/plugin/internal/XFSHoster.py +++ b/pyload/plugin/internal/XFSHoster.py @@ -64,7 +64,7 @@ class XFSHoster(SimpleHoster): if self.account: account = self.account else: - account = self.pyfile.m.core.accountManager.getAccountPlugin(self.__name) + account = self.pyfile.m.core.accountManager.getAccountPlugin(self.__class__.__name__) if account and hasattr(account, "HOSTER_DOMAIN") and account.HOSTER_DOMAIN: self.HOSTER_DOMAIN = account.HOSTER_DOMAIN diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py index 46b375e7a..44bff909c 100644 --- a/pyload/utils/__init__.py +++ b/pyload/utils/__init__.py @@ -265,3 +265,4 @@ def load_translation(name, locale, default="en"): else: translation.install(True) return translation + diff --git a/pyload/webui/app/pyloadweb.py b/pyload/webui/app/pyloadweb.py index d7604918b..fd6e8c89a 100644 --- a/pyload/webui/app/pyloadweb.py +++ b/pyload/webui/app/pyloadweb.py @@ -94,7 +94,7 @@ def server_min(theme, file): def server_js(theme, file): response.headers['Content-Type'] = "text/javascript; charset=UTF-8" - if "/render/" in file or ".render." in file: + if "/render/" in file or ".render." in file or True: response.headers['Expires'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(time.time() + 24 * 7 * 60 * 60)) response.headers['Cache-control'] = "public" diff --git a/pyload/webui/app/utils.py b/pyload/webui/app/utils.py index fd0e14cfa..4a431493b 100644 --- a/pyload/webui/app/utils.py +++ b/pyload/webui/app/utils.py @@ -12,7 +12,7 @@ from pyload.api import has_permission, PERMS, ROLE def render_to_response(file, args={}, proc=[]): for p in proc: args.update(p()) - path = join(THEME, "tml", file) + path = "tml/" + file return env.get_template(path).render(**args) |