summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-14 15:37:58 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-14 15:37:58 +0200
commit9973f09a616900ab0900974da77d22b566598b5f (patch)
tree0669cdda0a367e1b53b7286f19b6aaf1b9e4004a /module
parentrevert premium account change see #309 (diff)
downloadpyload-9973f09a616900ab0900974da77d22b566598b5f.tar.xz
improved some code style issues
Diffstat (limited to 'module')
-rw-r--r--module/JsEngine.py2
-rw-r--r--module/PullEvents.py2
-rw-r--r--module/gui/Collector.py2
-rw-r--r--module/gui/ConnectionManager.py19
-rw-r--r--module/gui/MainWindow.py25
-rw-r--r--module/gui/Overview.py4
-rw-r--r--module/gui/SettingsWidget.py6
-rw-r--r--module/plugins/Plugin.py2
-rw-r--r--module/plugins/crypter/LinkSaveIn.py4
-rw-r--r--module/plugins/crypter/NCryptIn.py6
-rw-r--r--module/plugins/crypter/NetfolderIn.py4
-rw-r--r--module/plugins/crypter/RelinkUs.py6
-rw-r--r--module/plugins/hooks/ClickAndLoad.py26
-rw-r--r--module/plugins/hooks/ExternalScripts.py17
-rw-r--r--module/plugins/hooks/IRCInterface.py34
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py13
-rw-r--r--module/plugins/hoster/UploadStationCom.py4
-rw-r--r--module/plugins/hoster/UploadingCom.py25
-rw-r--r--module/plugins/hoster/Xdcc.py2
-rw-r--r--module/plugins/hoster/YourfilesTo.py2
-rw-r--r--module/remote/thriftbackend/Processor.py2
-rw-r--r--module/setup.py2
-rw-r--r--module/web/pyload_app.py4
-rw-r--r--module/web/templates/default/filemanager_ui.js4
24 files changed, 102 insertions, 115 deletions
diff --git a/module/JsEngine.py b/module/JsEngine.py
index 3549595f7..0b451c9dd 100644
--- a/module/JsEngine.py
+++ b/module/JsEngine.py
@@ -130,7 +130,7 @@ class JsEngine():
return res
def error(self):
- return _("No js engine detected, please install either Spidermonkey, ossp-js or pyv8")
+ return _("No js engine detected, please install either Spidermonkey, ossp-js, pyv8 or rhino")
if __name__ == "__main__":
js = JsEngine()
diff --git a/module/PullEvents.py b/module/PullEvents.py
index 4f250d2f7..5ec76765e 100644
--- a/module/PullEvents.py
+++ b/module/PullEvents.py
@@ -59,7 +59,7 @@ class Client():
self.events = []
def newEvents(self):
- return (len(self.events) > 0)
+ return len(self.events) > 0
def popEvent(self):
if not len(self.events):
diff --git a/module/gui/Collector.py b/module/gui/Collector.py
index caeff4460..6b0a54d2f 100644
--- a/module/gui/Collector.py
+++ b/module/gui/Collector.py
@@ -280,7 +280,7 @@ class CollectorModel(QAbstractItemModel):
def hasChildren(self, parent=QModelIndex()):
if not parent.isValid():
return True
- return (self.rowCount(parent) > 0)
+ return self.rowCount(parent) > 0
def canFetchMore(self, parent):
return False
diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py
index 51f39f2be..7a7a25f5f 100644
--- a/module/gui/ConnectionManager.py
+++ b/module/gui/ConnectionManager.py
@@ -213,16 +213,15 @@ class ConnectionManager(QWidget):
grid.addWidget(save, 6, 1)
self.setLayout(grid)
- self.controls = {}
- self.controls["name"] = name
- self.controls["host"] = host
- self.controls["local"] = local
- self.controls["user"] = user
- self.controls["password"] = password
- self.controls["port"] = port
- self.controls["save"] = save
- self.controls["cancel"] = cancel
-
+ self.controls = {"name": name,
+ "host": host,
+ "local": local,
+ "user": user,
+ "password": password,
+ "port": port,
+ "save": save,
+ "cancel": cancel}
+
self.connect(cancel, SIGNAL("clicked()"), self.hide)
self.connect(save, SIGNAL("clicked()"), self.slotDone)
self.connect(local, SIGNAL("stateChanged(int)"), self.slotLocalChanged)
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 46f7e54a3..a9ede10c5 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -126,15 +126,13 @@ class MainWindow(QMainWindow):
#self.statusbar.addPermanentWidget(self.serverStatus)
#menu
- self.menus = {}
- self.menus["file"] = self.menubar.addMenu(_("File"))
- self.menus["connections"] = self.menubar.addMenu(_("Connections"))
-
+ self.menus = {"file": self.menubar.addMenu(_("File")),
+ "connections": self.menubar.addMenu(_("Connections"))}
+
#menu actions
- self.mactions = {}
- self.mactions["exit"] = QAction(_("Exit"), self.menus["file"])
- self.mactions["manager"] = QAction(_("Connection manager"), self.menus["connections"])
-
+ self.mactions = {"exit": QAction(_("Exit"), self.menus["file"]),
+ "manager": QAction(_("Connection manager"), self.menus["connections"])}
+
#add menu actions
self.menus["file"].addAction(self.mactions["exit"])
self.menus["connections"].addAction(self.mactions["manager"])
@@ -145,12 +143,11 @@ class MainWindow(QMainWindow):
#tabs
self.tabw = QTabWidget()
- self.tabs = {}
- self.tabs["overview"] = {"w":QWidget()}
- self.tabs["queue"] = {"w":QWidget()}
- self.tabs["collector"] = {"w":QWidget()}
- self.tabs["accounts"] = {"w":QWidget()}
- self.tabs["settings"] = {}
+ self.tabs = {"overview": {"w": QWidget()},
+ "queue": {"w": QWidget()},
+ "collector": {"w": QWidget()},
+ "accounts": {"w": QWidget()},
+ "settings": {}}
#self.tabs["settings"]["s"] = QScrollArea()
self.tabs["settings"]["w"] = SettingsWidget()
#self.tabs["settings"]["s"].setWidgetResizable(True)
diff --git a/module/gui/Overview.py b/module/gui/Overview.py
index edc2e9ccc..50e9dd618 100644
--- a/module/gui/Overview.py
+++ b/module/gui/Overview.py
@@ -76,8 +76,8 @@ class OverviewModel(QAbstractListModel):
def getProgress(p):
for c in p.children:
if c.data["status"] == 13:
- return (_("Unpacking"), int(c.data["progress"]))
- return (_("Downloading"), self.queue.getProgress(p))
+ return _("Unpacking"), int(c.data["progress"])
+ return _("Downloading"), self.queue.getProgress(p)
d = self.queue._data
for p in d:
diff --git a/module/gui/SettingsWidget.py b/module/gui/SettingsWidget.py
index 7218cc570..8123fe139 100644
--- a/module/gui/SettingsWidget.py
+++ b/module/gui/SettingsWidget.py
@@ -118,7 +118,7 @@ class SettingsWidget(QWidget):
elif not item.type.find(";") == -1:
i.setCurrentIndex(i.findText(item.value))
elif item.type == "bool":
- if (True if item.value.lower() in ("1","true", "on", "an","yes") else False):
+ if True if item.value.lower() in ("1","true", "on", "an","yes") else False:
i.setCurrentIndex(0)
else:
i.setCurrentIndex(1)
@@ -149,7 +149,7 @@ class SettingsWidget(QWidget):
if i.currentText() != item.value:
self.connector.setConfigValue(k, option, i.currentText(), sec)
elif item.type == "bool":
- if ((True if item.value.lower() in ("1","true", "on", "an","yes") else False) ^ (not i.currentIndex())):
+ if (True if item.value.lower() in ("1","true", "on", "an","yes") else False) ^ (not i.currentIndex()):
self.connector.setConfigValue(k, option, not i.currentIndex(), sec)
else:
if i.text() != item.value:
@@ -190,7 +190,7 @@ class Section(QGroupBox):
i = QComboBox(self)
i.addItem(_("Yes"), QVariant(True))
i.addItem(_("No"), QVariant(False))
- if (True if option.value.lower() in ("1","true", "on", "an","yes") else False):
+ if True if option.value.lower() in ("1","true", "on", "an","yes") else False:
i.setCurrentIndex(0)
else:
i.setCurrentIndex(1)
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index cef839861..e23e9558f 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -170,7 +170,7 @@ class Plugin(object):
"""
#@TODO checksum check hook
- return (True, 10)
+ return True, 10
def setConf(self, option, value):
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index d77556b0d..03c385cb3 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -49,7 +49,7 @@ class LinkSaveIn(Crypter):
name = self.pyfile.package().name
folder = self.pyfile.package().folder
self.log.debug("%s: Default to pyfile name [%s] and folder [%s] for package" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
def handleCaptcha(self):
if "<b>Captcha:</b>" in self.html:
@@ -73,7 +73,7 @@ class LinkSaveIn(Crypter):
# Log and return
self.log.debug("%s: Javascript cipher key function [%s]" % (self.__name__, jk))
- return (crypted, jk)
+ return crypted, jk
def getLinks(self, crypted, jk):
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 438ee9d0d..d2438b285 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -89,7 +89,7 @@ class NCryptIn(Crypter):
name = self.package.name
folder = self.package.folder
self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
def unlockProtection(self):
@@ -152,7 +152,7 @@ class NCryptIn(Crypter):
try:
url = link.replace("link-", "frame-")
link = self.load(url, just_header=True)['location']
- except Exception as e:
+ except Exception, e:
self.log.debug("%s: Error decrypting Web link %s, %s" % (self.__name__, link, e))
package_links.append(link)
return package_links
@@ -196,7 +196,7 @@ class NCryptIn(Crypter):
# Log and return
self.log.debug("%s: Detected %d crypted blocks" % (self.__name__, len(vcrypted)))
- return (vcrypted, vjk)
+ return vcrypted, vjk
def _getLinks(self, crypted, jk):
diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py
index 9d27c33d6..995eb4d4c 100644
--- a/module/plugins/crypter/NetfolderIn.py
+++ b/module/plugins/crypter/NetfolderIn.py
@@ -71,12 +71,12 @@ class NetfolderIn(Crypter):
if m is not None:
name = folder = m.group('title')
self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
else:
name = self.pyfile.package().name
folder = self.pyfile.package().folder
self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
def getLinks(self):
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 8391deeb4..64fbb9214 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -96,12 +96,12 @@ class RelinkUs(Crypter):
if m is not None:
name = folder = m.group('title')
self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
else:
name = self.package.name
folder = self.package.folder
self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder))
- return (name, folder)
+ return name, folder
def getCipherParams(self):
@@ -120,7 +120,7 @@ class RelinkUs(Crypter):
# Log and return
self.log.debug("%s: Javascript cipher key function [%s]" % (self.__name__, jk))
- return (crypted, jk)
+ return crypted, jk
def getLinks(self, crypted, jk):
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py
index 0ca492cb7..97e5cd57d 100644
--- a/module/plugins/hooks/ClickAndLoad.py
+++ b/module/plugins/hooks/ClickAndLoad.py
@@ -27,31 +27,32 @@ class ClickAndLoad(Hook):
__name__ = "ClickAndLoad"
__version__ = "0.2"
__description__ = """Gives abillity to use jd's click and load. depends on webinterface"""
- __config__ = [ ("activated", "bool", "Activated" , "True"),
- ("extern", "bool", "Allow external link adding", "False") ]
+ __config__ = [("activated", "bool", "Activated", "True"),
+ ("extern", "bool", "Allow external link adding", "False")]
__author_name__ = ("RaNaN", "mkaay")
__author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de")
-
+
def coreReady(self):
- self.port = int(self.core.config['webinterface']['port'])
+ self.port = int(self.core.config['webinterface']['port'])
if self.core.config['webinterface']['activated']:
try:
- if self.getConfig("extern"):
- ip = "0.0.0.0"
- else:
- ip = "127.0.0.1"
-
+ if self.getConfig("extern"):
+ ip = "0.0.0.0"
+ else:
+ ip = "127.0.0.1"
+
thread.start_new_thread(proxy, (self, ip, self.port, 9666))
except:
self.log.error("ClickAndLoad port already in use.")
def proxy(self, *settings):
- thread.start_new_thread(server, (self,)+settings)
+ thread.start_new_thread(server, (self,) + settings)
lock = thread.allocate_lock()
lock.acquire()
lock.acquire()
+
def server(self, *settings):
try:
dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -72,9 +73,10 @@ def server(self, *settings):
if errno == 98:
self.core.log.warning(_("Click'N'Load: Port 9666 already in use"))
return
- thread.start_new_thread(server, (self,)+settings)
+ thread.start_new_thread(server, (self,) + settings)
except:
- thread.start_new_thread(server, (self,)+settings)
+ thread.start_new_thread(server, (self,) + settings)
+
def forward(source, destination):
string = ' '
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 8d749b5bd..63ff2b170 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -49,18 +49,15 @@ class ExternalScripts(Hook):
self.core.check_file(script_folders, _("folders for scripts"), True)
f = lambda x: False if x.startswith("#") or x.endswith("~") else True
- self.scripts = {}
-
-
- self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing')))
- self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished')))
- self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished')))
- self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect')))
- self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect')))
- self.scripts['unrar_finished'] = filter(f, listdir(join(folder, 'unrar_finished')))
+ self.scripts = {'download_preparing': filter(f, listdir(join(folder, 'download_preparing'))),
+ 'download_finished': filter(f, listdir(join(folder, 'download_finished'))),
+ 'package_finished': filter(f, listdir(join(folder, 'package_finished'))),
+ 'before_reconnect': filter(f, listdir(join(folder, 'before_reconnect'))),
+ 'after_reconnect': filter(f, listdir(join(folder, 'after_reconnect'))),
+ 'unrar_finished': filter(f, listdir(join(folder, 'unrar_finished')))}
for script_type, script_name in self.scripts.iteritems():
- if script_name != []:
+ if script_name:
self.log.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name)))
#~ self.core.logger.info("Installed Scripts: %s" % str(self.scripts))
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index 31d693018..0142c3610 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -132,7 +132,7 @@ class IRCInterface(Thread, Hook):
line = line.rstrip()
first = line.split()
- if(first[0] == "PING"):
+ if first[0] == "PING":
self.sock.send("PONG %s\r\n" % first[1])
if first[0] == "ERROR":
@@ -213,8 +213,7 @@ class IRCInterface(Thread, Hook):
return ["INFO: There are no active downloads currently."]
temp_progress = ""
- lines = []
- lines.append("ID - Name - Status - Speed - ETA - Progress")
+ lines = ["ID - Name - Status - Speed - ETA - Progress"]
for data in downloads:
if data['statusmsg'] == 'waiting':
@@ -401,21 +400,20 @@ class IRCInterface(Thread, Hook):
def event_help(self, args):
- lines = []
- lines.append("The following commands are available:")
- lines.append("add <package|packid> <links> [...] Adds link to package. (creates new package if it does not exist)")
- lines.append("queue Shows all packages in the queue")
- lines.append("collector Shows all packages in collector")
- lines.append("del -p|-l <id> [...] Deletes all packages|links with the ids specified")
- lines.append("info <id> Shows info of the link with id <id>")
- lines.append("packinfo <id> Shows info of the package with id <id>")
- lines.append("more Shows more info when the result was truncated")
- lines.append("start Starts all downloads")
- lines.append("stop Stops the download (but not abort active downloads)")
- lines.append("push <id> Push package to queue")
- lines.append("pull <id> Pull package from queue")
- lines.append("status Show general download status")
- lines.append("help Shows this help message")
+ lines = ["The following commands are available:",
+ "add <package|packid> <links> [...] Adds link to package. (creates new package if it does not exist)",
+ "queue Shows all packages in the queue",
+ "collector Shows all packages in collector",
+ "del -p|-l <id> [...] Deletes all packages|links with the ids specified",
+ "info <id> Shows info of the link with id <id>",
+ "packinfo <id> Shows info of the package with id <id>",
+ "more Shows more info when the result was truncated",
+ "start Starts all downloads",
+ "stop Stops the download (but not abort active downloads)",
+ "push <id> Push package to queue",
+ "pull <id> Pull package from queue",
+ "status Show general download status",
+ "help Shows this help message"]
return lines
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 6dd8933c0..360f0d788 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -72,9 +72,8 @@ class ShareonlineBiz(Hoster):
src = self.load(api_url_base, cookies=False, post=api_param_file)
fields = src.split(";")
- self.api_data = {}
- self.api_data["fileid"] = fields[0]
- self.api_data["status"] = fields[1]
+ self.api_data = {"fileid": fields[0],
+ "status": fields[1]}
if not self.api_data["status"] == "OK":
self.offline()
self.api_data["filename"] = fields[2]
@@ -88,7 +87,7 @@ class ShareonlineBiz(Hoster):
self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1", "choice": "free"})
if re.search(r"/failure/full/1", self.req.lastEffectiveURL):
self.setWait(120)
- self.log.info("%s: no free slots, waiting 120 seconds" % (self.__name__))
+ self.log.info("%s: no free slots, waiting 120 seconds" % self.__name__)
self.wait()
self.retry()
@@ -160,8 +159,8 @@ class ShareonlineBiz(Hoster):
f.close()
hexd = h.hexdigest()
if hexd == self.api_data["checksum"]:
- return (True, 0)
+ return True, 0
else:
- return (False, 1)
+ return False, 1
else:
- return (True, 5)
+ return True, 5
diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py
index b45472747..32ab1972a 100644
--- a/module/plugins/hoster/UploadStationCom.py
+++ b/module/plugins/hoster/UploadStationCom.py
@@ -118,7 +118,7 @@ class UploadStationCom(Hoster):
self.load(self.pyfile.url, post={"downloadLink" : "show"})
# This may either download our file or forward us to an error page
- self.log.debug("%s: Downloading file." % (self.__name__))
+ self.log.debug("%s: Downloading file." % self.__name__)
dl = self.download(self.pyfile.url, post={"download" : "normal"})
self.handleDownloadedFile()
@@ -145,7 +145,7 @@ class UploadStationCom(Hoster):
def handleCaptchaErrors(self, response):
if UploadStationCom.CAPTCHA_WRONG_TOKEN in response:
- self.log.info("%s: Invalid captcha response, retrying." % (self.__name__))
+ self.log.info("%s: Invalid captcha response, retrying." % self.__name__)
self.invalidCaptcha()
self.retry()
else:
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index 1f3889f0e..3fb2d4ba2 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -68,10 +68,9 @@ class UploadingCom(Hoster):
self.download(url)
def handlePremium(self):
- postData = {}
- postData['action'] = 'get_link'
- postData['code'] = re.search('code: "(.*?)",', self.html[0]).group(1)
- postData['pass'] = 'undefined'
+ postData = {'action': 'get_link',
+ 'code': re.search('code: "(.*?)",', self.html[0]).group(1),
+ 'pass': 'undefined'}
self.html[2] = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData)
url = re.search(r'"link"\s*:\s*"(.*?)"', self.html[2])
@@ -84,11 +83,10 @@ class UploadingCom(Hoster):
self.code = re.search(r'name="code" value="(.*?)"', self.html[0]).group(1)
self.fileid = re.search(r'name="file_id" value="(.*?)"', self.html[0]).group(1)
- postData = {}
- postData['action'] = 'second_page'
- postData['code'] = self.code
- postData['file_id'] = self.fileid
-
+ postData = {'action': 'second_page',
+ 'code': self.code,
+ 'file_id': self.fileid}
+
self.html[1] = self.load(self.pyfile.url, post=postData)
wait_time = re.search(r'timead_counter">(\d+)<', self.html[1])
@@ -102,11 +100,10 @@ class UploadingCom(Hoster):
self.wait()
- postData = {}
- postData['action'] = 'get_link'
- postData['code'] = self.code
- postData['pass'] = 'undefined'
-
+ postData = {'action': 'get_link',
+ 'code': self.code,
+ 'pass': 'undefined'}
+
if r'var captcha_src' in self.html[1]:
captcha_url = "http://uploading.com/general/captcha/download%s/?ts=%d" % (self.fileid, timestamp())
postData['captcha_code'] = self.decryptCaptcha(captcha_url)
diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py
index 7c81ccbe0..849748249 100644
--- a/module/plugins/hoster/Xdcc.py
+++ b/module/plugins/hoster/Xdcc.py
@@ -156,7 +156,7 @@ class Xdcc(Hoster):
line = line.rstrip()
first = line.split()
- if(first[0] == "PING"):
+ if first[0] == "PING":
sock.send("PONG %s\r\n" % first[1])
if first[0] == "ERROR":
diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py
index 18f2d3edf..2c3656c95 100644
--- a/module/plugins/hoster/YourfilesTo.py
+++ b/module/plugins/hoster/YourfilesTo.py
@@ -57,7 +57,7 @@ class YourfilesTo(Hoster):
"""
url = re.search(r"var bla = '(.*?)';", self.html).group(1)
url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", ""))
- return url;
+ return url
def get_file_name(self):
if self.html is None:
diff --git a/module/remote/thriftbackend/Processor.py b/module/remote/thriftbackend/Processor.py
index 8aea42960..cd7e81a91 100644
--- a/module/remote/thriftbackend/Processor.py
+++ b/module/remote/thriftbackend/Processor.py
@@ -21,7 +21,7 @@ class Processor(Pyload.Processor):
if name not in self._processMap or (not authenticated and not name == "login"):
iprot.skip(Pyload.TType.STRUCT)
iprot.readMessageEnd()
- x = Pyload.TApplicationException(Pyload.TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+ x = Pyload.TApplicationException(Pyload.TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % name)
oprot.writeMessageBegin(name, Pyload.TMessageType.EXCEPTION, seqid)
x.write(oprot)
oprot.writeMessageEnd()
diff --git a/module/setup.py b/module/setup.py
index a8a7f9058..cab945784 100644
--- a/module/setup.py
+++ b/module/setup.py
@@ -135,7 +135,7 @@ class Setup():
if not js:
print _("no JavaScript engine found")
- print _("You will need this for some Click'N'Load links. Install Spidermonkey or ossp-js")
+ print _("You will need this for some Click'N'Load links. Install Spidermonkey, ossp-js, pyv8 or rhino")
print _("You can abort the setup now and fix some dependicies if you want.")
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py
index 693d08d06..784127f72 100644
--- a/module/web/pyload_app.py
+++ b/module/web/pyload_app.py
@@ -397,9 +397,7 @@ def path(file="", path=""):
for f in folders:
try:
f = f.decode(getfilesystemencoding())
- data = {}
- data['name'] = f
- data['fullpath'] = join(cwd, f)
+ data = {'name': f, 'fullpath': join(cwd, f)}
data['sort'] = data['fullpath'].lower()
data['modified'] = datetime.fromtimestamp(int(os.path.getmtime(join(cwd, f))))
data['ext'] = os.path.splitext(f)[1]
diff --git a/module/web/templates/default/filemanager_ui.js b/module/web/templates/default/filemanager_ui.js
index 0b801316c..ed64ab69d 100644
--- a/module/web/templates/default/filemanager_ui.js
+++ b/module/web/templates/default/filemanager_ui.js
@@ -104,7 +104,7 @@ var Item = new Class({
this.directories = [];
this.files = [];
this.actions = new Array();
- this.actions["delete"] = this.delete;
+ this.actions["delete"] = this.del;
this.actions["rename"] = this.rename;
this.actions["mkdir"] = this.mkdir;
this.parseElement();
@@ -152,7 +152,7 @@ var Item = new Class({
//TODO sort the main ul again (to keep data ordered after renaming something)
},
- delete: function(event) {
+ del: function(event) {
$("confirm_form").removeEvents("submit");
$("confirm_form").addEvent("submit", this.deleteDirectory.bind(this));