diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-04-10 13:37:02 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-06-28 02:51:58 +0200 |
commit | 2ff2fb0495febe11d5015d2308d67e1d8048e597 (patch) | |
tree | 2ae9d1da4a701fc6b3945ccc32dfbbf102b9c85a | |
parent | Localization badge (diff) | |
download | pyload-2ff2fb0495febe11d5015d2308d67e1d8048e597.tar.xz |
Some code cosmetics about commas, spaces and quotes
Merges #577
62 files changed, 623 insertions, 622 deletions
diff --git a/docs/write_hooks.rst b/docs/write_hooks.rst index f17e91ce5..351b9af39 100644 --- a/docs/write_hooks.rst +++ b/docs/write_hooks.rst @@ -35,7 +35,7 @@ Using the Config We are taking a closer look at the ``__config__`` parameter. You can add more config values as desired by adding tuples of the following format to the config list: ``("name", "type", "description", "default value")``. -When everything went right you can access the config values with ``self.getConfig(name)`` and ``self.setConfig(name,value``. +When everything went right you can access the config values with ``self.getConfig(name)`` and ``self.setConfig(name, value``. Interacting on Events @@ -81,7 +81,7 @@ It requires a `dict` that maps event names to function names or a `list` of func """ Your Hook code here. """ - event_map = {"downloadFinished" : "doSomeWork", + event_map = {"downloadFinished": "doSomeWork", "allDownloadsFnished": "someMethod", "coreReady": "initialize"} diff --git a/module/Api.py b/module/Api.py index c76d93438..348d9c8ee 100644 --- a/module/Api.py +++ b/module/Api.py @@ -1011,7 +1011,7 @@ class Api(Iface): def getAllInfo(self): """Returns all information stored by hook plugins. Values are always strings - :return: {"plugin": {"name": value } } + :return: {"plugin": {"name": value}} """ return self.core.hookManager.getAllInfo() diff --git a/module/ConfigParser.py b/module/ConfigParser.py index b5c5911b8..88e9055c6 100644 --- a/module/ConfigParser.py +++ b/module/ConfigParser.py @@ -24,8 +24,8 @@ class ConfigParser: { - section : { - option : { + section: { + option: { value: type: desc: diff --git a/module/ThreadManager.py b/module/ThreadManager.py index ec3e9efcf..b8662c514 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -262,8 +262,8 @@ class ThreadManager: free = [x for x in self.threads if not x.active] - inuse = set([(x.active.pluginname,self.getLimit(x)) for x in self.threads if x.active and x.active.hasPlugin() and x.active.plugin.account]) - inuse = map(lambda x : (x[0], x[1], len([y for y in self.threads if y.active and y.active.pluginname == x[0]])) ,inuse) + inuse = set([(x.active.pluginname, self.getLimit(x)) for x in self.threads if x.active and x.active.hasPlugin() and x.active.plugin.account]) + inuse = map(lambda x: (x[0], x[1], len([y for y in self.threads if y.active and y.active.pluginname == x[0]])) ,inuse) onlimit = [x[0] for x in inuse if x[1] > 0 and x[2] >= x[1]] occ = [x.active.pluginname for x in self.threads if x.active and x.active.hasPlugin() and not x.active.plugin.multiDL] + onlimit @@ -310,7 +310,7 @@ class ThreadManager: thread = PluginThread.DecrypterThread(self, job) def getLimit(self, thread): - limit = thread.active.plugin.account.getAccountData(thread.active.plugin.user)["options"].get("limitDL",["0"])[0] + limit = thread.active.plugin.account.getAccountData(thread.active.plugin.user)["options"].get("limitDL", ["0"])[0] return int(limit) def cleanup(self): diff --git a/module/cli/ManageFiles.py b/module/cli/ManageFiles.py index 4d0377d9d..d3dc14eff 100644 --- a/module/cli/ManageFiles.py +++ b/module/cli/ManageFiles.py @@ -107,7 +107,7 @@ class ManageFiles(Handler): elif self.mode == "r": println(line, _("What do you want to restart?")) - println(line + 1, "Enter single number, comma seperated numbers or ranges. eg. 1,2,3 or 1-3.") + println(line + 1, "Enter single number, comma seperated numbers or ranges. eg. 1, 2, 3 or 1-3.") line += 2 else: println(line, _("Choose what yout want to do or enter package number.")) diff --git a/module/common/APIExerciser.py b/module/common/APIExerciser.py index 9fec308af..34b1529b5 100644 --- a/module/common/APIExerciser.py +++ b/module/common/APIExerciser.py @@ -23,7 +23,7 @@ def createURLs(): return urls -AVOID = (0,3,8) +AVOID = (0, 3, 8) idPool = 0 sumCalled = 0 diff --git a/module/config/default.conf b/module/config/default.conf index 2e9152ba2..cdb4801b7 100644 --- a/module/config/default.conf +++ b/module/config/default.conf @@ -37,7 +37,7 @@ download - "Download": int max_speed : "Max Download Speed in kb/s" = -1 bool limit_speed : "Limit Download Speed" = False str interface : "Download interface to bind (ip or Name)" = None - bool ipv6 : "Allow IPv6" = False + bool ipv6: "Allow IPv6" = False bool skip_existing : "Skip already existing files" = False permission - "Permissions": bool change_user : "Change user of running process" = False diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py index 0ef655450..a7e9c8849 100644 --- a/module/database/DatabaseBackend.py +++ b/module/database/DatabaseBackend.py @@ -222,7 +222,7 @@ class DatabaseBackend(Thread): SELECT p.id AS id, SUM(l.size) AS sizetotal, COUNT(l.id) AS linkstotal, linksdone, sizedone\ FROM packages p JOIN links l ON p.id = l.package LEFT OUTER JOIN\ (SELECT p.id AS id, COUNT(*) AS linksdone, SUM(l.size) AS sizedone \ - FROM packages p JOIN links l ON p.id = l.package AND l.status in (0,4,13) GROUP BY p.id) s ON s.id = p.id \ + FROM packages p JOIN links l ON p.id = l.package AND l.status in (0, 4, 13) GROUP BY p.id) s ON s.id = p.id \ GROUP BY p.id') #try to lower ids @@ -281,12 +281,12 @@ class DatabaseBackend(Thread): self.conn.rollback() def async(self, f, *args, **kwargs): - args = (self, ) + args + args = (self,) + args job = DatabaseJob(f, *args, **kwargs) self.jobs.put(job) def queue(self, f, *args, **kwargs): - args = (self, ) + args + args = (self,) + args job = DatabaseJob(f, *args, **kwargs) self.jobs.put(job) job.wait() diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index 2f7a4a82d..fdcafd3c4 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -540,7 +540,7 @@ class FileHandler: urls = [] for pyfile in data.itervalues(): - if pyfile["status"] not in (0, 12, 13): + if pyfile["status"] not in (0, 12, 13): urls.append((pyfile["url"], pyfile["plugin"])) self.core.threadManager.createInfoThread(urls, pid) @@ -577,19 +577,19 @@ class FileMethods(): @style.queue def filecount(self, queue): """returns number of files in queue""" - self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=?", (queue, )) + self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=?", (queue,)) return self.c.fetchone()[0] @style.queue def queuecount(self, queue): """ number of files in queue not finished yet""" - self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? AND l.status NOT IN (0,4)", (queue, )) + self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? AND l.status NOT IN (0, 4)", (queue,)) return self.c.fetchone()[0] @style.queue def processcount(self, queue, fid): """ number of files which have to be proccessed """ - self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? AND l.status IN (2,3,5,7,12) AND l.id != ?", (queue, str(fid))) + self.c.execute("SELECT COUNT(*) FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? AND l.status IN (2, 3, 5, 7, 12) AND l.id != ?", (queue, str(fid))) return self.c.fetchone()[0] @style.inner @@ -618,7 +618,7 @@ class FileMethods(): @style.queue def addLinks(self, links, package): - """ links is a list of tupels (url,plugin)""" + """ links is a list of tupels (url, plugin)""" order = self._nextFileOrder(package) orders = [order + x for x in range(len(links))] links = [(x[0], x[0], x[1], package, o) for x, o in zip(links, orders)] @@ -658,7 +658,7 @@ class FileMethods(): } """ - self.c.execute('SELECT l.id,l.url,l.name,l.size,l.status,l.error,l.plugin,l.package,l.linkorder FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? ORDER BY l.linkorder', (q,)) + self.c.execute('SELECT l.id, l.url, l.name, l.size, l.status, l.error, l.plugin, l.package, l.linkorder FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=? ORDER BY l.linkorder', (q,)) data = {} for r in self.c: data[r[0]] = { @@ -688,7 +688,7 @@ class FileMethods(): format: { - id: {'name': name ... 'links': {} }, ... + id: {'name': name ... 'links': {}}, ... } """ self.c.execute('SELECT p.id, p.name, p.folder, p.site, p.password, p.queue, p.packageorder, s.sizetotal, s.sizedone, s.linksdone, s.linkstotal \ @@ -717,7 +717,7 @@ class FileMethods(): @style.queue def getLinkData(self, id): """get link information as dict""" - self.c.execute('SELECT id,url,name,size,status,error,plugin,package,linkorder FROM links WHERE id=?', (str(id), )) + self.c.execute('SELECT id, url, name, size, status, error, plugin, package, linkorder FROM links WHERE id=?', (str(id),)) data = {} r = self.c.fetchone() if not r: @@ -741,7 +741,7 @@ class FileMethods(): @style.queue def getPackageData(self, id): """get data about links for a package""" - self.c.execute('SELECT id,url,name,size,status,error,plugin,package,linkorder FROM links WHERE package=? ORDER BY linkorder', (str(id), )) + self.c.execute('SELECT id, url, name, size, status, error, plugin, package, linkorder FROM links WHERE package=? ORDER BY linkorder', (str(id),)) data = {} for r in self.c: @@ -764,16 +764,16 @@ class FileMethods(): @style.async def updateLink(self, f): - self.c.execute('UPDATE links SET url=?,name=?,size=?,status=?,error=?,package=? WHERE id=?', (f.url, f.name, f.size, f.status, f.error, str(f.packageid), str(f.id))) + self.c.execute('UPDATE links SET url=?, name=?, size=?, status=?, error=?, package=? WHERE id=?', (f.url, f.name, f.size, f.status, f.error, str(f.packageid), str(f.id))) @style.queue def updatePackage(self, p): - self.c.execute('UPDATE packages SET name=?,folder=?,site=?,password=?,queue=? WHERE id=?', (p.name, p.folder, p.site, p.password, p.queue, str(p.id))) + self.c.execute('UPDATE packages SET name=?, folder=?, site=?, password=?, queue=? WHERE id=?', (p.name, p.folder, p.site, p.password, p.queue, str(p.id))) @style.queue def updateLinkInfo(self, data): """ data is list of tupels (name, size, status, url) """ - self.c.executemany('UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1,2,3,14)', data) + self.c.executemany('UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1, 2, 3, 14)', data) ids = [] self.c.execute('SELECT id FROM links WHERE url IN (\'%s\')' % "','".join([x[3] for x in data])) for r in self.c: @@ -809,7 +809,7 @@ class FileMethods(): @style.async def restartFile(self, id): - self.c.execute('UPDATE links SET status=3,error="" WHERE id=?', (str(id),)) + self.c.execute('UPDATE links SET status=3, error="" WHERE id=?', (str(id),)) @style.async def restartPackage(self, id): @@ -818,7 +818,7 @@ class FileMethods(): @style.queue def getPackage(self, id): """return package instance from id""" - self.c.execute("SELECT name,folder,site,password,queue,packageorder FROM packages WHERE id=?", (str(id), )) + self.c.execute("SELECT name, folder, site, password, queue, packageorder FROM packages WHERE id=?", (str(id),)) r = self.c.fetchone() if not r: return None return PyPackage(self.manager, id, * r) @@ -827,7 +827,7 @@ class FileMethods(): @style.queue def getFile(self, id): """return link instance from id""" - self.c.execute("SELECT url, name, size, status, error, plugin, package, linkorder FROM links WHERE id=?", (str(id), )) + self.c.execute("SELECT url, name, size, status, error, plugin, package, linkorder FROM links WHERE id=?", (str(id),)) r = self.c.fetchone() if not r: return None return PyFile(self.manager, id, * r) @@ -847,7 +847,7 @@ class FileMethods(): cmd += ")" - cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE ((p.queue=1 AND l.plugin NOT IN %s) OR l.plugin IN %s) AND l.status IN (2,3,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % (cmd, pre) + cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE ((p.queue=1 AND l.plugin NOT IN %s) OR l.plugin IN %s) AND l.status IN (2, 3, 14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % (cmd, pre) self.c.execute(cmd) # very bad! @@ -856,7 +856,7 @@ class FileMethods(): @style.queue def getPluginJob(self, plugins): """returns pyfile ids with suited plugins""" - cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE l.plugin IN %s AND l.status IN (2,3,14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % plugins + cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE l.plugin IN %s AND l.status IN (2, 3, 14) ORDER BY p.packageorder ASC, l.linkorder ASC LIMIT 5" % plugins self.c.execute(cmd) # very bad! @@ -871,12 +871,12 @@ class FileMethods(): @style.queue def deleteFinished(self): - self.c.execute("DELETE FROM links WHERE status IN (0,4)") + self.c.execute("DELETE FROM links WHERE status IN (0, 4)") self.c.execute("DELETE FROM packages WHERE NOT EXISTS(SELECT 1 FROM links WHERE packages.id=links.package)") @style.queue def restartFailed(self): - self.c.execute("UPDATE links SET status=3,error='' WHERE status IN (6, 8, 9)") + self.c.execute("UPDATE links SET status=3, error='' WHERE status IN (6, 8, 9)") @style.queue def findDuplicates(self, id, folder, filename): diff --git a/module/database/StorageDatabase.py b/module/database/StorageDatabase.py index a27866632..049f229f3 100644 --- a/module/database/StorageDatabase.py +++ b/module/database/StorageDatabase.py @@ -36,7 +36,7 @@ class StorageMethods(): if row is not None: return row[0] else: - db.c.execute("SELECT key, value FROM storage WHERE identifier=?", (identifier, )) + db.c.execute("SELECT key, value FROM storage WHERE identifier=?", (identifier,)) d = {} for row in db.c: d[row[0]] = row[1] diff --git a/module/database/UserDatabase.py b/module/database/UserDatabase.py index 0c781057d..c33dee2e8 100644 --- a/module/database/UserDatabase.py +++ b/module/database/UserDatabase.py @@ -26,7 +26,7 @@ class UserMethods(): @style.queue def checkAuth(db, user, password): c = db.c - c.execute('SELECT id, name, password, role, permission, template, email FROM "users" WHERE name=?', (user, )) + c.execute('SELECT id, name, password, role, permission, template, email FROM "users" WHERE name=?', (user,)) r = c.fetchone() if not r: return {} @@ -47,7 +47,7 @@ class UserMethods(): password = salt + h.hexdigest() c = db.c - c.execute('SELECT name FROM users WHERE name=?', (user, )) + c.execute('SELECT name FROM users WHERE name=?', (user,)) if c.fetchone() is not None: c.execute('UPDATE users SET password=? WHERE name=?', (password, user)) else: @@ -56,7 +56,7 @@ class UserMethods(): @style.queue def changePassword(db, user, oldpw, newpw): - db.c.execute('SELECT id, name, password FROM users WHERE name=?', (user, )) + db.c.execute('SELECT id, name, password FROM users WHERE name=?', (user,)) r = db.c.fetchone() if not r: return False @@ -103,6 +103,6 @@ class UserMethods(): @style.queue def removeUser(db, user): - db.c.execute('DELETE FROM users WHERE name=?', (user, )) + db.c.execute('DELETE FROM users WHERE name=?', (user,)) DatabaseBackend.registerSub(UserMethods) diff --git a/module/debug.py b/module/debug.py index aa1c9cdaf..d29d5628a 100644 --- a/module/debug.py +++ b/module/debug.py @@ -41,7 +41,7 @@ def initReport(): reports.append(f) for i, f in enumerate(reports): - print "%s. %s" % (i,f) + print "%s. %s" % (i, f) choice = raw_input("Choose Report: ") diff --git a/module/forwarder.py b/module/forwarder.py index 238283881..59c01fa53 100644 --- a/module/forwarder.py +++ b/module/forwarder.py @@ -27,7 +27,7 @@ from traceback import print_exc class Forwarder(): - def __init__(self, extip,extport=9666): + def __init__(self, extip, extport=9666): print "Start portforwarding to %s:%s" % (extip, extport) proxy(extip, extport, 9666) diff --git a/module/gui/AccountEdit.py b/module/gui/AccountEdit.py index 07a4cdad6..83472d4b5 100644 --- a/module/gui/AccountEdit.py +++ b/module/gui/AccountEdit.py @@ -30,7 +30,7 @@ class AccountEdit(QWidget): QMainWindow.__init__(self) self.setWindowTitle(_("Edit account")) - self.setWindowIcon(QIcon(join(pypath, "icons","logo.png"))) + self.setWindowIcon(QIcon(join(pypath, "icons", "logo.png"))) self.setLayout(QGridLayout()) l = self.layout() diff --git a/module/gui/CNLServer.py b/module/gui/CNLServer.py index b55555272..295cfa045 100644 --- a/module/gui/CNLServer.py +++ b/module/gui/CNLServer.py @@ -117,7 +117,7 @@ class CNLHandler(BaseHTTPRequestHandler): resp += "\r\n" self.start_response(resp) self.wfile.write(resp) - except Exception,e : + except Exception, e: self.send_error(500, str(e)) else: self.send_error(404, "Not Found") @@ -163,7 +163,7 @@ class CNLHandler(BaseHTTPRequestHandler): IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) - result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") + result = obj.decrypt(crypted).replace("\x00", "").replace("\r", "").split("\n") result = filter(lambda x: x != "", result) diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 50d45cf28..47da2bada 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -24,7 +24,7 @@ from module.utils import formatSize from module.remote.thriftbackend.ThriftClient import Destination, FileDoesNotExists, ElementType -statusMapReverse = dict((v,k) for k, v in statusMap.iteritems()) +statusMapReverse = dict((v, k) for k, v in statusMap.iteritems()) translatedStatusMap = {} # -> CollectorModel.__init__ diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index 8dfdf7dd2..eb6e68f02 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -40,7 +40,7 @@ class ConnectionManager(QWidget): buttonLayout = QVBoxLayout() self.setWindowTitle(_("pyLoad ConnectionManager")) - self.setWindowIcon(QIcon(join(pypath, "icons","logo.png"))) + self.setWindowIcon(QIcon(join(pypath, "icons", "logo.png"))) connList = QListWidget() @@ -118,7 +118,7 @@ class ConnectionManager(QWidget): self.connList.setCurrentItem(item) def slotNew(self): - data = {"id":uuid().hex, "type":"remote", "default":False, "name":"", "host":"", "port":"7228", "user":"admin", "password":""} + data = {"id": uuid().hex, "type":"remote", "default": False, "name":"", "host":"", "port":"7228", "user":"admin", "password":""} self.edit.setData(data) self.edit.show() @@ -183,7 +183,7 @@ class ConnectionManager(QWidget): QWidget.__init__(self) self.setWindowTitle(_("pyLoad ConnectionManager")) - self.setWindowIcon(QIcon(join(pypath, "icons","logo.png"))) + self.setWindowIcon(QIcon(join(pypath, "icons", "logo.png"))) grid = QGridLayout() @@ -201,7 +201,7 @@ class ConnectionManager(QWidget): password = QLineEdit() password.setEchoMode(QLineEdit.Password) port = QSpinBox() - port.setRange(1,10000) + port.setRange(1, 10000) save = QPushButton(_("Save")) cancel = QPushButton(_("Cancel")) diff --git a/module/gui/CoreConfigParser.py b/module/gui/CoreConfigParser.py index 84910da1a..cf0c24868 100644 --- a/module/gui/CoreConfigParser.py +++ b/module/gui/CoreConfigParser.py @@ -52,7 +52,7 @@ class ConfigParser: conf = {} - section, option, value, typ, desc = "","","","","" + section, option, value, typ, desc = "", "", "", "", "" listmode = False @@ -75,20 +75,20 @@ class ConfigParser: section, none, desc = line[:-1].partition('-') section = section.strip() desc = desc.replace('"', "").strip() - conf[section] = { "desc" : desc } + conf[section] = {"desc": desc} else: if listmode: if line.endswith("]"): listmode = False - line = line.replace("]","") + line = line.replace("]", "") value += [self.cast(typ, x.strip()) for x in line.split(",") if x] if not listmode: - conf[section][option] = { "desc" : desc, - "type" : typ, - "value" : value} + conf[section][option] = {"desc": desc, + "type": typ, + "value": value} else: content, none, value = line.partition("=") @@ -113,9 +113,9 @@ class ConfigParser: value = self.cast(typ, value) if not listmode: - conf[section][option] = { "desc" : desc, - "type" : typ, - "value" : value} + conf[section][option] = {"desc": desc, + "type": typ, + "value": value} except: pass @@ -132,7 +132,7 @@ class ConfigParser: if typ == "int": return int(value) elif typ == "bool": - return True if value.lower() in ("1","true", "on", "an","yes") else False + return True if value.lower() in ("1", "true", "on", "an", "yes") else False else: return value diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index d2e27a7a6..85a3bb59c 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -42,8 +42,8 @@ class MainWindow(QMainWindow): QMainWindow.__init__(self) #window stuff self.setWindowTitle(_("pyLoad Client")) - self.setWindowIcon(QIcon(join(pypath, "icons","logo.png"))) - self.resize(1000,600) + self.setWindowIcon(QIcon(join(pypath, "icons", "logo.png"))) + self.resize(1000, 600) #layout version self.version = 3 @@ -152,7 +152,7 @@ class MainWindow(QMainWindow): self.tabs["settings"]["w"] = SettingsWidget() #self.tabs["settings"]["s"].setWidgetResizable(True) #self.tabs["settings"]["s"].setWidget(self.tabs["settings"]["w"]) - self.tabs["log"] = {"w":QWidget()} + self.tabs["log"] = {"w": QWidget()} self.tabw.addTab(self.tabs["overview"]["w"], _("Overview")) self.tabw.addTab(self.tabs["queue"]["w"], _("Queue")) self.tabw.addTab(self.tabs["collector"]["w"], _("Collector")) @@ -189,19 +189,19 @@ class MainWindow(QMainWindow): """ self.toolbar = self.addToolBar(_("Hide Toolbar")) self.toolbar.setObjectName("Main Toolbar") - self.toolbar.setIconSize(QSize(30,30)) + self.toolbar.setIconSize(QSize(30, 30)) self.toolbar.setMovable(False) self.actions["toggle_status"] = self.toolbar.addAction(_("Toggle Pause/Resume")) pricon = QIcon() - pricon.addFile(join(pypath, "icons","toolbar_start.png"), QSize(), QIcon.Normal, QIcon.Off) - pricon.addFile(join(pypath, "icons","toolbar_pause.png"), QSize(), QIcon.Normal, QIcon.On) + pricon.addFile(join(pypath, "icons", "toolbar_start.png"), QSize(), QIcon.Normal, QIcon.Off) + pricon.addFile(join(pypath, "icons", "toolbar_pause.png"), QSize(), QIcon.Normal, QIcon.On) self.actions["toggle_status"].setIcon(pricon) self.actions["toggle_status"].setCheckable(True) - self.actions["status_stop"] = self.toolbar.addAction(QIcon(join(pypath, "icons","toolbar_stop.png")), _("Stop")) + self.actions["status_stop"] = self.toolbar.addAction(QIcon(join(pypath, "icons", "toolbar_stop.png")), _("Stop")) self.toolbar.addSeparator() - self.actions["add"] = self.toolbar.addAction(QIcon(join(pypath, "icons","toolbar_add.png")), _("Add")) + self.actions["add"] = self.toolbar.addAction(QIcon(join(pypath, "icons", "toolbar_add.png")), _("Add")) self.toolbar.addSeparator() - self.actions["clipboard"] = self.toolbar.addAction(QIcon(join(pypath, "icons","clipboard.png")), _("Check Clipboard")) + self.actions["clipboard"] = self.toolbar.addAction(QIcon(join(pypath, "icons", "clipboard.png")), _("Check Clipboard")) self.actions["clipboard"].setCheckable(True) self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) @@ -272,11 +272,11 @@ class MainWindow(QMainWindow): self.queueContext = QMenu() self.queueContext.buttons = {} self.queueContext.item = (None, None) - self.queueContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons","remove_small.png")), _("Remove"), self.queueContext) - self.queueContext.buttons["restart"] = QAction(QIcon(join(pypath, "icons","refresh_small.png")), _("Restart"), self.queueContext) - self.queueContext.buttons["pull"] = QAction(QIcon(join(pypath, "icons","pull_small.png")), _("Pull out"), self.queueContext) - self.queueContext.buttons["abort"] = QAction(QIcon(join(pypath, "icons","abort.png")), _("Abort"), self.queueContext) - self.queueContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons","edit_small.png")), _("Edit Name"), self.queueContext) + self.queueContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons", "remove_small.png")), _("Remove"), self.queueContext) + self.queueContext.buttons["restart"] = QAction(QIcon(join(pypath, "icons", "refresh_small.png")), _("Restart"), self.queueContext) + self.queueContext.buttons["pull"] = QAction(QIcon(join(pypath, "icons", "pull_small.png")), _("Pull out"), self.queueContext) + self.queueContext.buttons["abort"] = QAction(QIcon(join(pypath, "icons", "abort.png")), _("Abort"), self.queueContext) + self.queueContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons", "edit_small.png")), _("Edit Name"), self.queueContext) self.queueContext.addAction(self.queueContext.buttons["pull"]) self.queueContext.addAction(self.queueContext.buttons["edit"]) self.queueContext.addAction(self.queueContext.buttons["remove"]) @@ -292,14 +292,14 @@ class MainWindow(QMainWindow): self.collectorContext = QMenu() self.collectorContext.buttons = {} self.collectorContext.item = (None, None) - self.collectorContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons","remove_small.png")), _("Remove"), self.collectorContext) - self.collectorContext.buttons["push"] = QAction(QIcon(join(pypath, "icons","push_small.png")), _("Push to queue"), self.collectorContext) - self.collectorContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons","edit_small.png")), _("Edit Name"), self.collectorContext) - self.collectorContext.buttons["restart"] = QAction(QIcon(join(pypath, "icons","refresh_small.png")), _("Restart"), self.collectorContext) - self.collectorContext.buttons["refresh"] = QAction(QIcon(join(pypath, "icons","refresh1_small.png")),_("Refresh Status"), self.collectorContext) + self.collectorContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons", "remove_small.png")), _("Remove"), self.collectorContext) + self.collectorContext.buttons["push"] = QAction(QIcon(join(pypath, "icons", "push_small.png")), _("Push to queue"), self.collectorContext) + self.collectorContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons", "edit_small.png")), _("Edit Name"), self.collectorContext) + self.collectorContext.buttons["restart"] = QAction(QIcon(join(pypath, "icons", "refresh_small.png")), _("Restart"), self.collectorContext) + self.collectorContext.buttons["refresh"] = QAction(QIcon(join(pypath, "icons", "refresh1_small.png")), _("Refresh Status"), self.collectorContext) self.collectorContext.addAction(self.collectorContext.buttons["push"]) self.collectorContext.addSeparator() - self.collectorContext.buttons["add"] = self.collectorContext.addMenu(QIcon(join(pypath, "icons","add_small.png")), _("Add")) + self.collectorContext.buttons["add"] = self.collectorContext.addMenu(QIcon(join(pypath, "icons", "add_small.png")), _("Add")) self.collectorContext.addAction(self.collectorContext.buttons["edit"]) self.collectorContext.addAction(self.collectorContext.buttons["remove"]) self.collectorContext.addAction(self.collectorContext.buttons["restart"]) @@ -319,9 +319,9 @@ class MainWindow(QMainWindow): self.accountContext = QMenu() self.accountContext.buttons = {} - self.accountContext.buttons["add"] = QAction(QIcon(join(pypath, "icons","add_small.png")), _("Add"), self.accountContext) - self.accountContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons","remove_small.png")), _("Remove"), self.accountContext) - self.accountContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons","edit_small.png")), _("Edit"), self.accountContext) + self.accountContext.buttons["add"] = QAction(QIcon(join(pypath, "icons", "add_small.png")), _("Add"), self.accountContext) + self.accountContext.buttons["remove"] = QAction(QIcon(join(pypath, "icons", "remove_small.png")), _("Remove"), self.accountContext) + self.accountContext.buttons["edit"] = QAction(QIcon(join(pypath, "icons", "edit_small.png")), _("Edit"), self.accountContext) self.accountContext.addAction(self.accountContext.buttons["add"]) self.accountContext.addAction(self.accountContext.buttons["edit"]) self.accountContext.addAction(self.accountContext.buttons["remove"]) diff --git a/module/gui/Overview.py b/module/gui/Overview.py index a7c82e7d0..6c9957eba 100644 --- a/module/gui/Overview.py +++ b/module/gui/Overview.py @@ -154,7 +154,7 @@ class OverviewDelegate(QItemDelegate): else: speedline = QString(formatEta(eta) + " " + _("Speed: %s") % formatSpeed(speed)) - if progress in (0,100): + if progress in (0, 100): sizeline = QString(_("Size:") + "%s" % formatSize(maxSize)) else: sizeline = QString(_("Size:") + "%s / %s" % (formatSize(currentSize), formatSize(maxSize))) diff --git a/module/gui/SettingsWidget.py b/module/gui/SettingsWidget.py index ebe849d48..4e8440667 100644 --- a/module/gui/SettingsWidget.py +++ b/module/gui/SettingsWidget.py @@ -117,7 +117,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) @@ -141,7 +141,7 @@ class SettingsWidget(QWidget): if item.name in widget.inputs: i = widget.inputs[item.name] - #TODO : unresolved reference: option + #TODO: unresolved reference: option if item.type == "int": if i.value() != int(item.value): @@ -150,7 +150,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: @@ -191,7 +191,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/gui/connector.py b/module/gui/connector.py index 68cc531ce..c96389e91 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -91,7 +91,7 @@ class Connector(QObject): self.connectionID = uuid().hex if not server_version == SERVER_VERSION: - self.emit(SIGNAL("errorBox"), _("server is version %(new)s client accepts version %(current)s") % { "new": server_version, "current": SERVER_VERSION}) + self.emit(SIGNAL("errorBox"), _("server is version %(new)s client accepts version %(current)s") % {"new": server_version, "current": SERVER_VERSION}) return False return True diff --git a/module/lib/BeautifulSoup.py b/module/lib/BeautifulSoup.py index 55567f588..9f61c3ca0 100644 --- a/module/lib/BeautifulSoup.py +++ b/module/lib/BeautifulSoup.py @@ -483,15 +483,15 @@ class Tag(PageElement): def _invert(h): "Cheap function to invert a hash." i = {} - for k,v in h.items(): + for k, v in h.items(): i[v] = k return i - XML_ENTITIES_TO_SPECIAL_CHARS = { "apos" : "'", - "quot" : '"', - "amp" : "&", - "lt" : "<", - "gt" : ">" } + XML_ENTITIES_TO_SPECIAL_CHARS = {"apos": "'", + "quot": '"', + "amp": "&", + "lt": "<", + "gt": ">"} XML_SPECIAL_CHARS_TO_ENTITIES = _invert(XML_ENTITIES_TO_SPECIAL_CHARS) @@ -929,7 +929,7 @@ class SoupStrainer: markupAttrMap = markupAttrs else: markupAttrMap = {} - for k,v in markupAttrs: + for k, v in markupAttrs: markupAttrMap[k] = v attrValue = markupAttrMap.get(attr) if not self._matches(attrValue, matchAgainst): @@ -1018,7 +1018,7 @@ def buildTagMap(default, *args): for portion in args: if hasattr(portion, 'items'): #It's a map. Merge it. - for k,v in portion.items(): + for k, v in portion.items(): built[k] = v elif hasattr(portion, '__iter__'): # is a list #It's a list. Map each item to the default. @@ -1150,7 +1150,7 @@ class BeautifulStoneSoup(Tag, SGMLParser): n = int(name) except ValueError: return - if not 0 <= n <= 127 : # ASCII ends at 127, not 255 + if not 0 <= n <= 127: # ASCII ends at 127, not 255 return return self.convert_codepoint(n) @@ -1758,7 +1758,7 @@ class UnicodeDammit: # meta tags to the corresponding Python codec names. It only covers # values that aren't in Python's aliases and can't be determined # by the heuristics in find_codec. - CHARSET_ALIASES = { "macintosh" : "mac-roman", + CHARSET_ALIASES = {"macintosh": "mac-roman", "x-sjis" : "shift-jis" } def __init__(self, markup, overrideEncodings=[], @@ -1947,23 +1947,23 @@ class UnicodeDammit: def _ebcdic_to_ascii(self, s): c = self.__class__ if not c.EBCDIC_TO_ASCII_MAP: - emap = (0,1,2,3,156,9,134,127,151,141,142,11,12,13,14,15, - 16,17,18,19,157,133,8,135,24,25,146,143,28,29,30,31, - 128,129,130,131,132,10,23,27,136,137,138,139,140,5,6,7, - 144,145,22,147,148,149,150,4,152,153,154,155,20,21,158,26, - 32,160,161,162,163,164,165,166,167,168,91,46,60,40,43,33, - 38,169,170,171,172,173,174,175,176,177,93,36,42,41,59,94, - 45,47,178,179,180,181,182,183,184,185,124,44,37,95,62,63, - 186,187,188,189,190,191,192,193,194,96,58,35,64,39,61,34, - 195,97,98,99,100,101,102,103,104,105,196,197,198,199,200, - 201,202,106,107,108,109,110,111,112,113,114,203,204,205, - 206,207,208,209,126,115,116,117,118,119,120,121,122,210, - 211,212,213,214,215,216,217,218,219,220,221,222,223,224, - 225,226,227,228,229,230,231,123,65,66,67,68,69,70,71,72, - 73,232,233,234,235,236,237,125,74,75,76,77,78,79,80,81, - 82,238,239,240,241,242,243,92,159,83,84,85,86,87,88,89, - 90,244,245,246,247,248,249,48,49,50,51,52,53,54,55,56,57, - 250,251,252,253,254,255) + emap = (0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31, + 128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7, + 144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26, + 32, 160, 161, 162, 163, 164, 165, 166, 167, 168, 91, 46, 60, 40, 43, 33, + 38, 169, 170, 171, 172, 173, 174, 175, 176, 177, 93, 36, 42, 41, 59, 94, + 45, 47, 178, 179, 180, 181, 182, 183, 184, 185, 124, 44, 37, 95, 62, 63, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 96, 58, 35, 64, 39, 61, 34, + 195, 97, 98, 99, 100, 101, 102, 103, 104, 105, 196, 197, 198, 199, 200, + 201, 202, 106, 107, 108, 109, 110, 111, 112, 113, 114, 203, 204, 205, + 206, 207, 208, 209, 126, 115, 116, 117, 118, 119, 120, 121, 122, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 123, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 232, 233, 234, 235, 236, 237, 125, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 238, 239, 240, 241, 242, 243, 92, 159, 83, 84, 85, 86, 87, 88, 89, + 90, 244, 245, 246, 247, 248, 249, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 250, 251, 252, 253, 254, 255) import string c.EBCDIC_TO_ASCII_MAP = string.maketrans( \ ''.join(map(chr, range(256))), ''.join(map(chr, emap))) @@ -2000,7 +2000,8 @@ class UnicodeDammit: '\x9c' : ('oelig', '153'), '\x9d' : '?', '\x9e' : ('#x17E', '17E'), - '\x9f' : ('Yuml', ''),} + '\x9f' : ('Yuml', '') + } ####################################################################### diff --git a/module/lib/Getch.py b/module/lib/Getch.py index c88e65089..a052f619e 100644 --- a/module/lib/Getch.py +++ b/module/lib/Getch.py @@ -65,7 +65,7 @@ class _GetchMacCarbon: else: # # The event contains the following info: - # (what,msg,when,where,mod)=Carbon.Evt.GetNextEvent(0x0008)[1] + # (what, msg, when, where, mod)=Carbon.Evt.GetNextEvent(0x0008)[1] # # The message (msg) contains the ASCII char which is # extracted with the 0x000000FF charCodeMask; this diff --git a/module/lib/MultipartPostHandler.py b/module/lib/MultipartPostHandler.py index 94aee0193..4c0271c25 100644 --- a/module/lib/MultipartPostHandler.py +++ b/module/lib/MultipartPostHandler.py @@ -32,8 +32,8 @@ Example: cookies = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies), MultipartPostHandler.MultipartPostHandler) - params = { "username" : "bob", "password" : "riviera", - "file" : open("filename", "rb") } + params = {"username": "bob", "password": "riviera", + "file": open("filename", "rb") } opener.open("http://wwww.bobsite.com/upload/", params) Further Example: @@ -123,9 +123,9 @@ def main(): def validateFile(url): temp = tempfile.mkstemp(suffix=".html") write(temp[0], opener.open(url).read()) - params = { "ss" : "0", # show source - "doctype" : "Inline", - "uploaded_file" : open(temp[1], "rb") } + params = {"ss": "0", # show source + "doctype": "Inline", + "uploaded_file": open(temp[1], "rb") } print opener.open(validatorURL, params).read() remove(temp[1]) diff --git a/module/lib/Unzip.py b/module/lib/Unzip.py index 6d2ada8f2..c04b9abe8 100644 --- a/module/lib/Unzip.py +++ b/module/lib/Unzip.py @@ -18,8 +18,8 @@ class Unzip: for i, name in enumerate(zf.namelist()): if not name.endswith('/') and not name.endswith("config"): - print "extracting", name.replace("pyload/","") - outfile = open(os.path.join(dir, name.replace("pyload/","")), 'wb') + print "extracting", name.replace("pyload/", "") + outfile = open(os.path.join(dir, name.replace("pyload/", "")), 'wb') outfile.write(zf.read(name)) outfile.flush() outfile.close() @@ -44,7 +44,7 @@ class Unzip: for name in zf.namelist(): if name.endswith('/'): - dirs.append(name.replace("pyload/","")) + dirs.append(name.replace("pyload/", "")) dirs.sort() return dirs diff --git a/module/lib/beaker/crypto/pbkdf2.py b/module/lib/beaker/crypto/pbkdf2.py index 6c683ef30..5f40a5c78 100644 --- a/module/lib/beaker/crypto/pbkdf2.py +++ b/module/lib/beaker/crypto/pbkdf2.py @@ -78,7 +78,7 @@ def strxor(a, b): return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b)]) class PBKDF2(object): - """PBKDF2.py : PKCS#5 v2.0 Password-Based Key Derivation + """PBKDF2.py: PKCS#5 v2.0 Password-Based Key Derivation This implementation takes a passphrase and a salt (and optionally an iteration count, a digest module, and a MAC module) and provides a diff --git a/module/lib/beaker/ext/memcached.py b/module/lib/beaker/ext/memcached.py index 2f367c36d..60360ae0a 100644 --- a/module/lib/beaker/ext/memcached.py +++ b/module/lib/beaker/ext/memcached.py @@ -45,7 +45,7 @@ class MemcachedNamespaceManager(NamespaceManager): def get_creation_lock(self, key): return file_synchronizer( - identifier="memcachedcontainer/funclock/%s" % self.namespace,lock_dir = self.lock_dir) + identifier="memcachedcontainer/funclock/%s" % self.namespace, lock_dir = self.lock_dir) def _format_key(self, key): return self.namespace + '_' + key.replace(' ', '\302\267') diff --git a/module/lib/beaker/session.py b/module/lib/beaker/session.py index 7957be66b..a1461ebdd 100644 --- a/module/lib/beaker/session.py +++ b/module/lib/beaker/session.py @@ -15,7 +15,7 @@ from base64 import b64encode, b64decode __all__ = ['SignedCookie', 'Session'] -getpid = hasattr(os, 'getpid') and os.getpid or (lambda : '') +getpid = hasattr(os, 'getpid') and os.getpid or (lambda: '') class SignedCookie(Cookie.BaseCookie): """Extends python cookie to give digital signature support""" diff --git a/module/lib/beaker/util.py b/module/lib/beaker/util.py index 21a467e42..0bd82bb85 100644 --- a/module/lib/beaker/util.py +++ b/module/lib/beaker/util.py @@ -16,7 +16,7 @@ import warnings import sys py3k = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0) -py24 = sys.version_info < (2,5) +py24 = sys.version_info < (2, 5) jython = sys.platform.startswith('java') if py3k or jython: diff --git a/module/lib/bottle.py b/module/lib/bottle.py index f4e93de9d..b0111e870 100644 --- a/module/lib/bottle.py +++ b/module/lib/bottle.py @@ -88,7 +88,7 @@ except ImportError: # pragma: no cover raise ImportError("JSON support requires Python 2.6 or simplejson.") json_lds = json_dumps -py3k = sys.version_info >= (3,0,0) +py3k = sys.version_info >= (3, 0, 0) NCTextIOWrapper = None if py3k: # pragma: no cover @@ -98,7 +98,7 @@ if py3k: # pragma: no cover def touni(x, enc='utf8', err='strict'): """ Convert anything to unicode """ return str(x, enc, err) if isinstance(x, bytes) else str(x) - if sys.version_info < (3,2,0): + if sys.version_info < (3, 2, 0): from io import TextIOWrapper class NCTextIOWrapper(TextIOWrapper): ''' Garbage collecting an io.TextIOWrapper(buffer) instance closes @@ -394,7 +394,7 @@ class Router(object): if not builder: raise RouteBuildError("No route with that name.", _name) try: for i, value in enumerate(anons): query['anon%d'%i] = value - url = ''.join([f(query.pop(n)) if n else f for (n,f) in builder]) + url = ''.join([f(query.pop(n)) if n else f for (n, f) in builder]) return url if not query else url+'?'+urlencode(query) except KeyError, e: raise RouteBuildError('Missing URL argument: %r' % e.args[0]) @@ -425,7 +425,7 @@ class Router(object): if 'GET' in allowed and 'HEAD' not in allowed: allowed.append('HEAD') raise HTTPError(405, "Method not allowed.", - header=[('Allow',",".join(allowed))]) + header=[('Allow', ",".join(allowed))]) @@ -1876,12 +1876,12 @@ def parse_date(ims): def parse_auth(header): - """ Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or None""" + """ Parse rfc2617 HTTP authentication header string (basic) and return (user, pass) tuple or None""" try: method, data = header.split(None, 1) if method.lower() == 'basic': #TODO: Add 2to3 save base64[encode/decode] functions. - user, pwd = touni(base64.b64decode(tob(data))).split(':',1) + user, pwd = touni(base64.b64decode(tob(data))).split(':', 1) return user, pwd except (KeyError, ValueError): return None @@ -2049,7 +2049,7 @@ class ServerAdapter(object): pass def __repr__(self): - args = ', '.join(['%s=%s'%(k,repr(v)) for k, v in self.options.items()]) + args = ', '.join(['%s=%s'%(k, repr(v)) for k, v in self.options.items()]) return "%s(%s)" % (self.__class__.__name__, args) @@ -2598,9 +2598,9 @@ class SimpleTALTemplate(BaseTemplate): for dictarg in args: kwargs.update(dictarg) # TODO: maybe reuse a context instead of always creating one context = simpleTALES.Context() - for k,v in self.defaults.items(): + for k, v in self.defaults.items(): context.addGlobal(k, v) - for k,v in kwargs.items(): + for k, v in kwargs.items(): context.addGlobal(k, v) output = StringIO() self.tpl.expand(context, output) @@ -2691,7 +2691,7 @@ class SimpleTemplate(BaseTemplate): if m: self.encoding = m.group(1) if m: line = line.replace('coding','coding (removed)') if line.strip()[:2].count('%') == 1: - line = line.split('%',1)[1].lstrip() # Full line following the % + line = line.split('%', 1)[1].lstrip() # Full line following the % cline = self.split_comment(line).strip() cmd = re.split(r'[^a-zA-Z0-9_]', cline)[0] flush() # You are actually reading this? Good luck, it's a mess :) @@ -2749,7 +2749,7 @@ class SimpleTemplate(BaseTemplate): subtpl, rargs = env['_rebase'] rargs['_base'] = _stdout[:] #copy stdout del _stdout[:] # clear stdout - return self.subtemplate(subtpl,_stdout,rargs) + return self.subtemplate(subtpl, _stdout, rargs) return env def render(self, *args, **kwargs): @@ -2839,7 +2839,7 @@ HTTP_CODES[428] = "Precondition Required" HTTP_CODES[429] = "Too Many Requests" HTTP_CODES[431] = "Request Header Fields Too Large" HTTP_CODES[511] = "Network Authentication Required" -_HTTP_STATUS_LINES = dict((k, '%d %s'%(k,v)) for (k,v) in HTTP_CODES.iteritems()) +_HTTP_STATUS_LINES = dict((k, '%d %s'%(k, v)) for (k, v) in HTTP_CODES.iteritems()) #: The default template used for error pages. Override with @error() ERROR_PAGE_TEMPLATE = """ diff --git a/module/lib/feedparser.py b/module/lib/feedparser.py index 32f9d2dd7..8d3fec678 100644 --- a/module/lib/feedparser.py +++ b/module/lib/feedparser.py @@ -52,7 +52,7 @@ USER_AGENT = "UniversalFeedParser/%s +http://feedparser.org/" % __version__ # HTTP "Accept" header to send to servers when downloading feeds. If you don't # want to send an Accept header, set this to None. -ACCEPT_HEADER = "application/atom+xml,application/rdf+xml,application/rss+xml,application/x-netcdf,application/xml;q=0.9,text/xml;q=0.2,*/*;q=0.1" +ACCEPT_HEADER = "application/atom+xml, application/rdf+xml, application/rss+xml, application/x-netcdf, application/xml;q=0.9, text/xml;q=0.2,*/*;q=0.1" # List of preferred XML parsers, by SAX driver name. These will be tried first, # but if they're not installed, Python will keep searching through its own list @@ -167,7 +167,7 @@ try: _XML_AVAILABLE = 1 except: _XML_AVAILABLE = 0 - def _xmlescape(data,entities={}): + def _xmlescape(data, entities={}): data = data.replace('&', '&') data = data.replace('>', '>') data = data.replace('<', '<') @@ -203,7 +203,7 @@ except: import htmlentitydefs name2codepoint={} codepoint2name={} - for (name,codepoint) in htmlentitydefs.entitydefs.iteritems(): + for (name, codepoint) in htmlentitydefs.entitydefs.iteritems(): if codepoint.startswith('&#'): codepoint=unichr(int(codepoint[2:-1])) name2codepoint[name]=ord(codepoint) codepoint2name[ord(codepoint)]=name @@ -235,8 +235,8 @@ if sgmllib.endbracket.search(' <').start(0): # Overriding the built-in sgmllib.endbracket regex allows the # parser to find angle brackets embedded in element attributes. self.endbracket = re.compile('''([^'"<>]|"[^"]*"(?=>|/|\s|\w+=)|'[^']*'(?=>|/|\s|\w+=))*(?=[<>])|.*?(?=[<>])''') - def search(self,string,index=0): - match = self.endbracket.match(string,index) + def search(self, string, index=0): + match = self.endbracket.match(string, index) if match is not None: # Returning a new object in the calling thread's context # resolves a thread-safety. @@ -299,7 +299,7 @@ class FeedParserDict(UserDict): if key == 'category': return UserDict.__getitem__(self, 'tags')[0]['term'] if key == 'enclosures': - norel = lambda link: FeedParserDict([(name,value) for (name,value) in link.items() if name!='rel']) + norel = lambda link: FeedParserDict([(name, value) for (name, value) in link.items() if name!='rel']) return [norel(link) for link in UserDict.__getitem__(self, 'links') if link['rel']=='enclosure'] if key == 'license': for link in UserDict.__getitem__(self, 'links'): @@ -378,22 +378,22 @@ def _ebcdic_to_ascii(s): global _ebcdic_to_ascii_map if not _ebcdic_to_ascii_map: emap = ( - 0,1,2,3,156,9,134,127,151,141,142,11,12,13,14,15, - 16,17,18,19,157,133,8,135,24,25,146,143,28,29,30,31, - 128,129,130,131,132,10,23,27,136,137,138,139,140,5,6,7, - 144,145,22,147,148,149,150,4,152,153,154,155,20,21,158,26, - 32,160,161,162,163,164,165,166,167,168,91,46,60,40,43,33, - 38,169,170,171,172,173,174,175,176,177,93,36,42,41,59,94, - 45,47,178,179,180,181,182,183,184,185,124,44,37,95,62,63, - 186,187,188,189,190,191,192,193,194,96,58,35,64,39,61,34, - 195,97,98,99,100,101,102,103,104,105,196,197,198,199,200,201, - 202,106,107,108,109,110,111,112,113,114,203,204,205,206,207,208, - 209,126,115,116,117,118,119,120,121,122,210,211,212,213,214,215, - 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231, - 123,65,66,67,68,69,70,71,72,73,232,233,234,235,236,237, - 125,74,75,76,77,78,79,80,81,82,238,239,240,241,242,243, - 92,159,83,84,85,86,87,88,89,90,244,245,246,247,248,249, - 48,49,50,51,52,53,54,55,56,57,250,251,252,253,254,255 + 0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31, + 128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7, + 144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26, + 32, 160, 161, 162, 163, 164, 165, 166, 167, 168, 91, 46, 60, 40, 43, 33, + 38, 169, 170, 171, 172, 173, 174, 175, 176, 177, 93, 36, 42, 41, 59, 94, + 45, 47, 178, 179, 180, 181, 182, 183, 184, 185, 124, 44, 37, 95, 62, 63, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 96, 58, 35, 64, 39, 61, 34, + 195, 97, 98, 99, 100, 101, 102, 103, 104, 105, 196, 197, 198, 199, 200, 201, + 202, 106, 107, 108, 109, 110, 111, 112, 113, 114, 203, 204, 205, 206, 207, 208, + 209, 126, 115, 116, 117, 118, 119, 120, 121, 122, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 123, 65, 66, 67, 68, 69, 70, 71, 72, 73, 232, 233, 234, 235, 236, 237, + 125, 74, 75, 76, 77, 78, 79, 80, 81, 82, 238, 239, 240, 241, 242, 243, + 92, 159, 83, 84, 85, 86, 87, 88, 89, 90, 244, 245, 246, 247, 248, 249, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 250, 251, 252, 253, 254, 255 ) _ebcdic_to_ascii_map = _maketrans( \ _l2bytes(range(256)), _l2bytes(emap)) @@ -780,7 +780,7 @@ class _FeedParserMixin: return data def strattrs(self, attrs): - return ''.join([' %s="%s"' % (t[0],_xmlescape(t[1],{'"':'"'})) for t in attrs]) + return ''.join([' %s="%s"' % (t[0], _xmlescape(t[1], {'"':'"'})) for t in attrs]) def push(self, element, expectingText): self.elementstack.append([element, expectingText, []]) @@ -796,9 +796,9 @@ class _FeedParserMixin: # only if all the remaining content is nested underneath it. # This means that the divs would be retained in the following: # <div>foo</div><div>bar</div> - while pieces and len(pieces)>1 and not pieces[-1].strip(): + while pieces and len(pieces)> 1 and not pieces[-1].strip(): del pieces[-1] - while pieces and len(pieces)>1 and not pieces[0].strip(): + while pieces and len(pieces)> 1 and not pieces[0].strip(): del pieces[0] if pieces and (pieces[0] == '<div>' or pieces[0].startswith('<div ')) and pieces[-1]=='</div>': depth = 0 @@ -1271,7 +1271,7 @@ class _FeedParserMixin: else: author, email = context.get(key), None if not author: return - emailmatch = re.search(r'''(([a-zA-Z0-9\_\-\.\+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?))(\?subject=\S+)?''', author) + emailmatch = re.search(r'''(([a-zA-Z0-9\_\-\.\+]+)@((\[[0-9]{1, 3}\.[0-9]{1, 3}\.[0-9]{1, 3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2, 4}|[0-9]{1, 3})(\]?))(\?subject=\S+)?''', author) if emailmatch: email = emailmatch.group(0) # probably a better way to do the following, but it passes all the tests @@ -1756,7 +1756,7 @@ if _XML_AVAILABLE: if prefix: localname = prefix.lower() + ':' + localname elif namespace and not qname: #Expat - for name,value in self.namespacesInUse.items(): + for name, value in self.namespacesInUse.items(): if name and value == namespace: localname = name + ':' + localname break @@ -1786,7 +1786,7 @@ if _XML_AVAILABLE: if prefix: localname = prefix + ':' + localname elif namespace and not qname: #Expat - for name,value in self.namespacesInUse.items(): + for name, value in self.namespacesInUse.items(): if name and value == namespace: localname = name + ':' + localname break @@ -1827,10 +1827,10 @@ class _BaseHTMLProcessor(sgmllib.SGMLParser): else: return '<' + tag + '></' + tag + '>' - def parse_starttag(self,i): + def parse_starttag(self, i): j=sgmllib.SGMLParser.parse_starttag(self, i) if self._type == 'application/xhtml+xml': - if j>2 and self.rawdata[j-2:j]=='/>': + if j > 2 and self.rawdata[j-2:j]=='/>': self.unknown_endtag(self.lasttag) return j @@ -1902,7 +1902,7 @@ class _BaseHTMLProcessor(sgmllib.SGMLParser): # called for each character reference, e.g. for ' ', ref will be '160' # Reconstruct the original character reference. if ref.startswith('x'): - value = unichr(int(ref[1:],16)) + value = unichr(int(ref[1:], 16)) else: value = unichr(int(ref)) @@ -2000,7 +2000,7 @@ class _LooseFeedParser(_FeedParserMixin, _BaseHTMLProcessor): return data def strattrs(self, attrs): - return ''.join([' %s="%s"' % (n,v.replace('"','"')) for n,v in attrs]) + return ''.join([' %s="%s"' % (n, v.replace('"','"')) for n, v in attrs]) class _MicroformatsParser: STRING = 1 @@ -2010,7 +2010,7 @@ class _MicroformatsParser: EMAIL = 5 known_xfn_relationships = ['contact', 'acquaintance', 'friend', 'met', 'co-worker', 'coworker', 'colleague', 'co-resident', 'coresident', 'neighbor', 'child', 'parent', 'sibling', 'brother', 'sister', 'spouse', 'wife', 'husband', 'kin', 'relative', 'muse', 'crush', 'date', 'sweetheart', 'me'] - known_binary_extensions = ['zip','rar','exe','gz','tar','tgz','tbz2','bz2','z','7z','dmg','img','sit','sitx','hqx','deb','rpm','bz2','jar','rar','iso','bin','msi','mp2','mp3','ogg','ogm','mp4','m4v','m4a','avi','wma','wmv'] + known_binary_extensions = ['zip','rar','exe','gz','tar','tgz','tbz2','bz2','z','7z','dmg','img','sit','sitx','hqx','deb','rpm','bz2','jar','rar','iso','bin','msi','mp2','mp3','ogg','ogm','mp4','m4v','m4a','avi','wma','wmv'] def __init__(self, data, baseuri, encoding): self.document = BeautifulSoup.BeautifulSoup(data) @@ -2545,7 +2545,7 @@ class _HTMLSanitizer(_BaseHTMLProcessor): 'transparent', 'underline', 'white', 'yellow'] valid_css_values = re.compile('^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|' + - '\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$') + '\d{0, 2}\.?\d{0, 2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$') mathml_elements = ['annotation', 'annotation-xml', 'maction', 'math', 'merror', 'mfenced', 'mfrac', 'mi', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', @@ -2651,25 +2651,25 @@ class _HTMLSanitizer(_BaseHTMLProcessor): self.svg_elements = lower self.svg_elem_map = dict([(a.lower(),a) for a in mix]) acceptable_attributes = self.svg_attributes - tag = self.svg_elem_map.get(tag,tag) + tag = self.svg_elem_map.get(tag, tag) keymap = self.svg_attr_map elif not tag in self.acceptable_elements: return # declare xlink namespace, if needed if self.mathmlOK or self.svgOK: - if filter(lambda (n,v): n.startswith('xlink:'),attrs): + if filter(lambda (n, v): n.startswith('xlink:'), attrs): if not ('xmlns:xlink','http://www.w3.org/1999/xlink') in attrs: attrs.append(('xmlns:xlink','http://www.w3.org/1999/xlink')) clean_attrs = [] for key, value in self.normalize_attrs(attrs): if key in acceptable_attributes: - key=keymap.get(key,key) - clean_attrs.append((key,value)) + key=keymap.get(key, key) + clean_attrs.append((key, value)) elif key=='style': clean_value = self.sanitize_style(value) - if clean_value: clean_attrs.append((key,clean_value)) + if clean_value: clean_attrs.append((key, clean_value)) _BaseHTMLProcessor.unknown_starttag(self, tag, clean_attrs) def unknown_endtag(self, tag): @@ -2679,7 +2679,7 @@ class _HTMLSanitizer(_BaseHTMLProcessor): if self.mathmlOK and tag in self.mathml_elements: if tag == 'math' and self.mathmlOK: self.mathmlOK -= 1 elif self.svgOK and tag in self.svg_elements: - tag = self.svg_elem_map.get(tag,tag) + tag = self.svg_elem_map.get(tag, tag) if tag == 'svg' and self.svgOK: self.svgOK -= 1 else: return @@ -2705,7 +2705,7 @@ class _HTMLSanitizer(_BaseHTMLProcessor): if re.sub("\s*[-\w]+\s*:\s*[^:;]*;?", '', style).strip(): return '' clean = [] - for prop,value in re.findall("([-\w]+)\s*:\s*([^:;]*)",style): + for prop, value in re.findall("([-\w]+)\s*:\s*([^:;]*)",style): if not value: continue if prop.lower() in self.acceptable_css_properties: clean.append(prop + ': ' + value + ';') @@ -2875,7 +2875,7 @@ def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, h # iri support try: - if isinstance(url_file_stream_or_string,unicode): + if isinstance(url_file_stream_or_string, unicode): url_file_stream_or_string = url_file_stream_or_string.encode('idna').decode('utf-8') else: url_file_stream_or_string = url_file_stream_or_string.decode('utf-8').encode('idna').decode('utf-8') @@ -2932,7 +2932,7 @@ def _build_urllib2_request(url, agent, etag, modified, referrer, auth, request_h if ACCEPT_HEADER: request.add_header('Accept', ACCEPT_HEADER) # use this for whatever -- cookies, special headers, etc - # [('Cookie','Something'),('x-special-header','Another Value')] + # [('Cookie','Something'), ('x-special-header','Another Value')] for header_name, header_value in request_headers.items(): request.add_header(header_name, header_value) request.add_header('A-IM', 'feed') # RFC 3229 support @@ -3391,8 +3391,8 @@ def _getCharacterEncoding(http_headers, xml_data): Furthermore, discussion on the atom-syntax mailing list with the author of RFC 3023 leads me to the conclusion that any document served with a Content-Type of text/* and no charset parameter - must be treated as us-ascii. (We now do this.) And also that it - must always be flagged as non-well-formed. (We now do this too.) + must be treated as us-ascii. (We now do this.) And also that it + must always be flagged as non-well-formed. (We now do this too.) If Content-Type is unspecified (input was local file or non-HTTP source) or unrecognized (server just got it totally wrong), then go by the @@ -3570,7 +3570,7 @@ def _stripDoctype(data): ''' start = re.search(_s2bytes('<\w'), data) start = start and start.start() or -1 - head,data = data[:start+1], data[start+1:] + head, data = data[:start+1], data[start+1:] entity_pattern = re.compile(_s2bytes(r'^\s*<!ENTITY([^>]*?)>'), re.MULTILINE) entity_results=entity_pattern.findall(head) @@ -3587,7 +3587,7 @@ def _stripDoctype(data): replacement=_s2bytes('') if len(doctype_results)==1 and entity_results: safe_pattern=re.compile(_s2bytes('\s+(\w+)\s+"(&#\w+;|[^&"]*)"')) - safe_entities=filter(lambda e: safe_pattern.match(e),entity_results) + safe_entities=filter(lambda e: safe_pattern.match(e), entity_results) if safe_entities: replacement=_s2bytes('<!DOCTYPE feed [\n <!ENTITY') + _s2bytes('>\n <!ENTITY ').join(safe_entities) + _s2bytes('>\n]>') data = doctype_pattern.sub(replacement, head) + data diff --git a/module/lib/jinja2/filters.py b/module/lib/jinja2/filters.py index d1848e434..97f06ed7d 100644 --- a/module/lib/jinja2/filters.py +++ b/module/lib/jinja2/filters.py @@ -101,7 +101,7 @@ def do_xmlattr(_eval_ctx, d, autospace=True): .. sourcecode:: html+jinja - <ul{{ {'class': 'my_list', 'missing': none, + <ul{{{'class': 'my_list', 'missing': none, 'id': 'list-%d'|format(variable)}|xmlattr }}> ... </ul> diff --git a/module/lib/jinja2/nodes.py b/module/lib/jinja2/nodes.py index 6446c70ea..f6cdc0d89 100644 --- a/module/lib/jinja2/nodes.py +++ b/module/lib/jinja2/nodes.py @@ -507,7 +507,7 @@ class Keyword(Helper): class CondExpr(Expr): - """A conditional expression (inline if expression). (``{{ + """A conditional expression (inline if expression). (``{{ foo if bar else baz }}``) """ fields = ('test', 'expr1', 'expr2') diff --git a/module/lib/jinja2/utils.py b/module/lib/jinja2/utils.py index 7b77b8eb7..186fc6c44 100644 --- a/module/lib/jinja2/utils.py +++ b/module/lib/jinja2/utils.py @@ -269,7 +269,7 @@ def urlize(text, trim_url_limit=None, nofollow=False): attribute. """ trim_url = lambda x, limit=trim_url_limit: limit is not None \ - and (x[:limit] + (len(x) >=limit and '...' + and (x[:limit] + (len(x) >= limit and '...' or '')) or x words = _word_split_re.split(unicode(escape(text))) nofollow_attr = nofollow and ' rel="nofollow"' or '' diff --git a/module/lib/simplejson/__init__.py b/module/lib/simplejson/__init__.py index 03748041d..368d4202b 100644 --- a/module/lib/simplejson/__init__.py +++ b/module/lib/simplejson/__init__.py @@ -31,8 +31,8 @@ Encoding basic Python object hierarchies:: Compact encoding:: >>> import simplejson as json - >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) - '[1,2,3,{"4":5,"6":7}]' + >>> json.dumps([1, 2, 3, {'4': 5, '6': 7}], separators=(',',':')) + '[1, 2, 3, {"4": 5, "6": 7}]' Pretty printing:: diff --git a/module/lib/thrift/Thrift.py b/module/lib/thrift/Thrift.py index 1d271fcff..8c270ea28 100644 --- a/module/lib/thrift/Thrift.py +++ b/module/lib/thrift/Thrift.py @@ -74,8 +74,8 @@ class TException(Exception): """Base class for all thrift exceptions.""" - # BaseException.message is deprecated in Python v[2.6,3.0) - if (2,6,0) <= sys.version_info < (3,0): + # BaseException.message is deprecated in Python v[2.6, 3.0) + if (2, 6, 0) <= sys.version_info < (3, 0): def _get_message(self): return self._message def _set_message(self, message): diff --git a/module/lib/thrift/protocol/TBinaryProtocol.py b/module/lib/thrift/protocol/TBinaryProtocol.py index 50c6aa896..0cc44178c 100644 --- a/module/lib/thrift/protocol/TBinaryProtocol.py +++ b/module/lib/thrift/protocol/TBinaryProtocol.py @@ -239,7 +239,7 @@ class TBinaryProtocolAccelerated(TBinaryProtocol): our C module to do the encoding, bypassing this object entirely. We inherit from TBinaryProtocol so that the normal TBinaryProtocol encoding can happen if the fastbinary module doesn't work for some - reason. (TODO(dreiss): Make this happen sanely in more cases.) + reason. (TODO(dreiss): Make this happen sanely in more cases.) In order to take advantage of the C module, just use TBinaryProtocolAccelerated instead of TBinaryProtocol. diff --git a/module/lib/thrift/protocol/TProtocol.py b/module/lib/thrift/protocol/TProtocol.py index e23774784..595ca5ae6 100644 --- a/module/lib/thrift/protocol/TProtocol.py +++ b/module/lib/thrift/protocol/TProtocol.py @@ -202,7 +202,7 @@ class TProtocolBase: # tuple of: ( 'reader method' name, is_container boolean, 'writer_method' name ) _TTYPE_HANDLERS = ( - (None, None, False), # 0 == TType,STOP + (None, None, False), # 0 == TType, STOP (None, None, False), # 1 == TType.VOID # TODO: handle void? ('readBool', 'writeBool', False), # 2 == TType.BOOL ('readByte', 'writeByte', False), # 3 == TType.BYTE and I08 @@ -298,7 +298,7 @@ class TProtocolBase: v_val = val_reader() else: v_val = self.readFieldByTType(val_ttype, val_spec) - # this raises a TypeError with unhashable keys types. i.e. d=dict(); d[[0,1]] = 2 fails + # this raises a TypeError with unhashable keys types. i.e. d=dict(); d[[0, 1]] = 2 fails results[k_val] = v_val self.readMapEnd() return results diff --git a/module/lib/thrift/transport/TTransport.py b/module/lib/thrift/transport/TTransport.py index 12e51a9bf..2b2e99eac 100644 --- a/module/lib/thrift/transport/TTransport.py +++ b/module/lib/thrift/transport/TTransport.py @@ -18,7 +18,7 @@ # from cStringIO import StringIO -from struct import pack,unpack +from struct import pack, unpack from thrift.Thrift import TException class TTransportException(TException): @@ -127,7 +127,7 @@ class TBufferedTransportFactory: return buffered -class TBufferedTransport(TTransportBase,CReadableTransport): +class TBufferedTransport(TTransportBase, CReadableTransport): """Class that wraps another transport and buffers its I/O. diff --git a/module/lib/thrift/transport/TTwisted.py b/module/lib/thrift/transport/TTwisted.py index b6dcb4e0b..141e299ca 100644 --- a/module/lib/thrift/transport/TTwisted.py +++ b/module/lib/thrift/transport/TTwisted.py @@ -79,7 +79,7 @@ class ThriftClientProtocol(basic.Int32StringReceiver): self.started.callback(self.client) def connectionLost(self, reason=connectionDone): - for k,v in self.client._reqs.iteritems(): + for k, v in self.client._reqs.iteritems(): tex = TTransport.TTransportException( type=TTransport.TTransportException.END_OF_FILE, message='Connection closed') diff --git a/module/lib/thrift/transport/TZlibTransport.py b/module/lib/thrift/transport/TZlibTransport.py index 4356e4933..89fa96f61 100644 --- a/module/lib/thrift/transport/TZlibTransport.py +++ b/module/lib/thrift/transport/TZlibTransport.py @@ -125,7 +125,7 @@ class TZlibTransport(TTransportBase, CReadableTransport): def getCompRatio(self): ''' - Get the current measured compression ratios (in,out) from + Get the current measured compression ratios (in, out) from this transport. Returns a tuple of: diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 14c24be15..eeb27cf30 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -269,7 +269,7 @@ class HTTPChunk(HTTPRequest): def stop(self): """The download will not proceed after next call of writeBody""" - self.range = [0,0] + self.range = [0, 0] self.size = 0 def resetRange(self): diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index ab2de1e94..4827b5e9d 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -286,7 +286,7 @@ class HTTPDownload(): if self.abort: raise Abort() - #sleep(0.003) #supress busy waiting - limits dl speed to (1 / x) * buffersize + #sleep(0.003) #supress busy waiting - limits dl speed to (1 / x) * buffersize self.m.select(1) for chunk in self.chunks: diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index 302ed75df..a01c3a54c 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -89,8 +89,8 @@ class HTTPRequest(): if pycurl.version_info()[7]: self.c.setopt(pycurl.ENCODING, "gzip, deflate") self.c.setopt(pycurl.HTTPHEADER, ["Accept: */*", - "Accept-Language: en-US,en", - "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language: en-US, en", + "Accept-Charset: ISO-8859-1, utf-8;q=0.7,*;q=0.7", "Connection: keep-alive", "Keep-Alive: 300", "Expect:"]) diff --git a/module/remote/ClickAndLoadBackend.py b/module/remote/ClickAndLoadBackend.py index ad8031587..82167f6e3 100644 --- a/module/remote/ClickAndLoadBackend.py +++ b/module/remote/ClickAndLoadBackend.py @@ -93,7 +93,7 @@ class CNLHandler(BaseHTTPRequestHandler): resp += "\r\n" self.start_response(resp) self.wfile.write(resp) - except Exception,e : + except Exception, e: self.send_error(500, str(e)) else: self.send_error(404, "Not Found") @@ -139,7 +139,7 @@ class CNLHandler(BaseHTTPRequestHandler): IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) - result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") + result = obj.decrypt(crypted).replace("\x00", "").replace("\r", "").split("\n") result = filter(lambda x: x != "", result) diff --git a/module/remote/thriftbackend/ThriftTest.py b/module/remote/thriftbackend/ThriftTest.py index 69ac6a745..a67d86b8d 100644 --- a/module/remote/thriftbackend/ThriftTest.py +++ b/module/remote/thriftbackend/ThriftTest.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- import sys -from os.path import join,abspath,dirname +from os.path import join, abspath, dirname -path = join((abspath(dirname(__file__))), "..","..", "lib") +path = join((abspath(dirname(__file__))), "..", "..", "lib") sys.path.append(path) from thriftgen.pyload import Pyload @@ -22,11 +22,11 @@ import xmlrpclib def bench(f, *args, **kwargs): s = time() - ret = [f(*args, **kwargs) for i in range(0,100)] + ret = [f(*args, **kwargs) for i in range(0, 100)] e = time() try: print "%s: %f s" % (f._Method__name, e-s) - except : + except: print "%s: %f s" % (f.__name__, e-s) return ret diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index 7f4560ecb..3aef7af00 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -194,7 +194,7 @@ struct OnlineStatus { 2: PluginName plugin, 3: string packagename, 4: DownloadStatus status, - 5: i64 size, // size <= 0 : unknown + 5: i64 size, // size <= 0: unknown } struct OnlineCheck { @@ -311,7 +311,7 @@ service Pyload { //services - // servicename : description + // servicename: description map<PluginName, map<string, string>> getServices(), bool hasService(1: PluginName plugin, 2: string func), string call(1: ServiceCall info) throws (1: ServiceDoesNotExists ex, 2: ServiceException e), @@ -319,7 +319,7 @@ service Pyload { //info // {plugin: {name: value}} - map<PluginName, map<string,string>> getAllInfo(), + map<PluginName, map<string, string>> getAllInfo(), map<string, string> getInfoByPlugin(1: PluginName plugin), //scheduler diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index bfaf5b078..dae1efa1b 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -4,7 +4,7 @@ # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # -# options string: py:slots,dynamic +# options string: py:slots, dynamic # import sys @@ -148,13 +148,13 @@ if cmd == 'getConfigValue': if len(args) != 3: print 'getConfigValue requires 3 args' sys.exit(1) - pp.pprint(client.getConfigValue(args[0],args[1],args[2],)) + pp.pprint(client.getConfigValue(args[0], args[1], args[2],)) elif cmd == 'setConfigValue': if len(args) != 4: print 'setConfigValue requires 4 args' sys.exit(1) - pp.pprint(client.setConfigValue(args[0],args[1],args[2],args[3],)) + pp.pprint(client.setConfigValue(args[0], args[1], args[2], args[3],)) elif cmd == 'getConfig': if len(args) != 0: @@ -256,7 +256,7 @@ elif cmd == 'parseURLs': if len(args) != 2: print 'parseURLs requires 2 args' sys.exit(1) - pp.pprint(client.parseURLs(args[0],args[1],)) + pp.pprint(client.parseURLs(args[0], args[1],)) elif cmd == 'checkOnlineStatus': if len(args) != 1: @@ -268,7 +268,7 @@ elif cmd == 'checkOnlineStatusContainer': if len(args) != 3: print 'checkOnlineStatusContainer requires 3 args' sys.exit(1) - pp.pprint(client.checkOnlineStatusContainer(eval(args[0]),args[1],args[2],)) + pp.pprint(client.checkOnlineStatusContainer(eval(args[0]), args[1], args[2],)) elif cmd == 'pollResults': if len(args) != 1: @@ -340,25 +340,25 @@ elif cmd == 'generateAndAddPackages': if len(args) != 2: print 'generateAndAddPackages requires 2 args' sys.exit(1) - pp.pprint(client.generateAndAddPackages(eval(args[0]),eval(args[1]),)) + pp.pprint(client.generateAndAddPackages(eval(args[0]), eval(args[1]),)) elif cmd == 'addPackage': if len(args) != 3: print 'addPackage requires 3 args' sys.exit(1) - pp.pprint(client.addPackage(args[0],eval(args[1]),eval(args[2]),)) + pp.pprint(client.addPackage(args[0], eval(args[1]), eval(args[2]),)) elif cmd == 'addFiles': if len(args) != 2: print 'addFiles requires 2 args' sys.exit(1) - pp.pprint(client.addFiles(eval(args[0]),eval(args[1]),)) + pp.pprint(client.addFiles(eval(args[0]), eval(args[1]),)) elif cmd == 'uploadContainer': if len(args) != 2: print 'uploadContainer requires 2 args' sys.exit(1) - pp.pprint(client.uploadContainer(args[0],args[1],)) + pp.pprint(client.uploadContainer(args[0], args[1],)) elif cmd == 'deleteFiles': if len(args) != 1: @@ -418,37 +418,37 @@ elif cmd == 'setPackageName': if len(args) != 2: print 'setPackageName requires 2 args' sys.exit(1) - pp.pprint(client.setPackageName(eval(args[0]),args[1],)) + pp.pprint(client.setPackageName(eval(args[0]), args[1],)) elif cmd == 'movePackage': if len(args) != 2: print 'movePackage requires 2 args' sys.exit(1) - pp.pprint(client.movePackage(eval(args[0]),eval(args[1]),)) + pp.pprint(client.movePackage(eval(args[0]), eval(args[1]),)) elif cmd == 'moveFiles': if len(args) != 2: print 'moveFiles requires 2 args' sys.exit(1) - pp.pprint(client.moveFiles(eval(args[0]),eval(args[1]),)) + pp.pprint(client.moveFiles(eval(args[0]), eval(args[1]),)) elif cmd == 'orderPackage': if len(args) != 2: print 'orderPackage requires 2 args' sys.exit(1) - pp.pprint(client.orderPackage(eval(args[0]),eval(args[1]),)) + pp.pprint(client.orderPackage(eval(args[0]), eval(args[1]),)) elif cmd == 'orderFile': if len(args) != 2: print 'orderFile requires 2 args' sys.exit(1) - pp.pprint(client.orderFile(eval(args[0]),eval(args[1]),)) + pp.pprint(client.orderFile(eval(args[0]), eval(args[1]),)) elif cmd == 'setPackageData': if len(args) != 2: print 'setPackageData requires 2 args' sys.exit(1) - pp.pprint(client.setPackageData(eval(args[0]),eval(args[1]),)) + pp.pprint(client.setPackageData(eval(args[0]), eval(args[1]),)) elif cmd == 'deleteFinished': if len(args) != 0: @@ -484,25 +484,25 @@ elif cmd == 'updateAccount': if len(args) != 4: print 'updateAccount requires 4 args' sys.exit(1) - pp.pprint(client.updateAccount(eval(args[0]),args[1],args[2],eval(args[3]),)) + pp.pprint(client.updateAccount(eval(args[0]), args[1], args[2], eval(args[3]),)) elif cmd == 'removeAccount': if len(args) != 2: print 'removeAccount requires 2 args' sys.exit(1) - pp.pprint(client.removeAccount(eval(args[0]),args[1],)) + pp.pprint(client.removeAccount(eval(args[0]), args[1],)) elif cmd == 'login': if len(args) != 2: print 'login requires 2 args' sys.exit(1) - pp.pprint(client.login(args[0],args[1],)) + pp.pprint(client.login(args[0], args[1],)) elif cmd == 'getUserData': if len(args) != 2: print 'getUserData requires 2 args' sys.exit(1) - pp.pprint(client.getUserData(args[0],args[1],)) + pp.pprint(client.getUserData(args[0], args[1],)) elif cmd == 'getAllUserData': if len(args) != 0: @@ -520,7 +520,7 @@ elif cmd == 'hasService': if len(args) != 2: print 'hasService requires 2 args' sys.exit(1) - pp.pprint(client.hasService(eval(args[0]),args[1],)) + pp.pprint(client.hasService(eval(args[0]), args[1],)) elif cmd == 'call': if len(args) != 1: @@ -562,7 +562,7 @@ elif cmd == 'setCaptchaResult': if len(args) != 2: print 'setCaptchaResult requires 2 args' sys.exit(1) - pp.pprint(client.setCaptchaResult(eval(args[0]),args[1],)) + pp.pprint(client.setCaptchaResult(eval(args[0]), args[1],)) else: print 'Unrecognized method %s' % cmd diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index a61ecf8fe..f0b356375 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -3,7 +3,7 @@ # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # -# options string: py:slots,dynamic +# options string: py:slots, dynamic # from thrift.Thrift import TType, TMessageType, TException @@ -32,34 +32,34 @@ class Iface(object): """ pass - def getConfig(self, ): + def getConfig(self,): pass - def getPluginConfig(self, ): + def getPluginConfig(self,): pass - def pauseServer(self, ): + def pauseServer(self,): pass - def unpauseServer(self, ): + def unpauseServer(self,): pass - def togglePause(self, ): + def togglePause(self,): pass - def statusServer(self, ): + def statusServer(self,): pass - def freeSpace(self, ): + def freeSpace(self,): pass - def getServerVersion(self, ): + def getServerVersion(self,): pass - def kill(self, ): + def kill(self,): pass - def restart(self, ): + def restart(self,): pass def getLog(self, offset): @@ -69,13 +69,13 @@ class Iface(object): """ pass - def isTimeDownload(self, ): + def isTimeDownload(self,): pass - def isTimeReconnect(self, ): + def isTimeReconnect(self,): pass - def toggleReconnect(self, ): + def toggleReconnect(self,): pass def generatePackages(self, links): @@ -123,7 +123,7 @@ class Iface(object): """ pass - def statusDownloads(self, ): + def statusDownloads(self,): pass def getPackageData(self, pid): @@ -147,16 +147,16 @@ class Iface(object): """ pass - def getQueue(self, ): + def getQueue(self,): pass - def getCollector(self, ): + def getCollector(self,): pass - def getQueueData(self, ): + def getQueueData(self,): pass - def getCollectorData(self, ): + def getCollectorData(self,): pass def getPackageOrder(self, destination): @@ -255,7 +255,7 @@ class Iface(object): """ pass - def stopAllDownloads(self, ): + def stopAllDownloads(self,): pass def stopDownloads(self, fids): @@ -313,10 +313,10 @@ class Iface(object): """ pass - def deleteFinished(self, ): + def deleteFinished(self,): pass - def restartFailed(self, ): + def restartFailed(self,): pass def getEvents(self, uuid): @@ -333,7 +333,7 @@ class Iface(object): """ pass - def getAccountTypes(self, ): + def getAccountTypes(self,): pass def updateAccount(self, plugin, account, password, options): @@ -370,10 +370,10 @@ class Iface(object): """ pass - def getAllUserData(self, ): + def getAllUserData(self,): pass - def getServices(self, ): + def getServices(self,): pass def hasService(self, plugin, func): @@ -391,7 +391,7 @@ class Iface(object): """ pass - def getAllInfo(self, ): + def getAllInfo(self,): pass def getInfoByPlugin(self, plugin): @@ -401,7 +401,7 @@ class Iface(object): """ pass - def isCaptchaWaiting(self, ): + def isCaptchaWaiting(self,): pass def getCaptchaTask(self, exclusive): @@ -454,7 +454,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getConfigValue(self, ): + def recv_getConfigValue(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -490,7 +490,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setConfigValue(self, ): + def recv_setConfigValue(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -502,18 +502,18 @@ class Client(Iface): self._iprot.readMessageEnd() return - def getConfig(self, ): + def getConfig(self,): self.send_getConfig() return self.recv_getConfig() - def send_getConfig(self, ): + def send_getConfig(self,): self._oprot.writeMessageBegin('getConfig', TMessageType.CALL, self._seqid) args = getConfig_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getConfig(self, ): + def recv_getConfig(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -527,18 +527,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getConfig failed: unknown result"); - def getPluginConfig(self, ): + def getPluginConfig(self,): self.send_getPluginConfig() return self.recv_getPluginConfig() - def send_getPluginConfig(self, ): + def send_getPluginConfig(self,): self._oprot.writeMessageBegin('getPluginConfig', TMessageType.CALL, self._seqid) args = getPluginConfig_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPluginConfig(self, ): + def recv_getPluginConfig(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -552,18 +552,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getPluginConfig failed: unknown result"); - def pauseServer(self, ): + def pauseServer(self,): self.send_pauseServer() self.recv_pauseServer() - def send_pauseServer(self, ): + def send_pauseServer(self,): self._oprot.writeMessageBegin('pauseServer', TMessageType.CALL, self._seqid) args = pauseServer_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pauseServer(self, ): + def recv_pauseServer(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -575,18 +575,18 @@ class Client(Iface): self._iprot.readMessageEnd() return - def unpauseServer(self, ): + def unpauseServer(self,): self.send_unpauseServer() self.recv_unpauseServer() - def send_unpauseServer(self, ): + def send_unpauseServer(self,): self._oprot.writeMessageBegin('unpauseServer', TMessageType.CALL, self._seqid) args = unpauseServer_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_unpauseServer(self, ): + def recv_unpauseServer(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -598,18 +598,18 @@ class Client(Iface): self._iprot.readMessageEnd() return - def togglePause(self, ): + def togglePause(self,): self.send_togglePause() return self.recv_togglePause() - def send_togglePause(self, ): + def send_togglePause(self,): self._oprot.writeMessageBegin('togglePause', TMessageType.CALL, self._seqid) args = togglePause_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_togglePause(self, ): + def recv_togglePause(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -623,18 +623,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "togglePause failed: unknown result"); - def statusServer(self, ): + def statusServer(self,): self.send_statusServer() return self.recv_statusServer() - def send_statusServer(self, ): + def send_statusServer(self,): self._oprot.writeMessageBegin('statusServer', TMessageType.CALL, self._seqid) args = statusServer_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_statusServer(self, ): + def recv_statusServer(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -648,18 +648,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "statusServer failed: unknown result"); - def freeSpace(self, ): + def freeSpace(self,): self.send_freeSpace() return self.recv_freeSpace() - def send_freeSpace(self, ): + def send_freeSpace(self,): self._oprot.writeMessageBegin('freeSpace', TMessageType.CALL, self._seqid) args = freeSpace_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_freeSpace(self, ): + def recv_freeSpace(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -673,18 +673,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "freeSpace failed: unknown result"); - def getServerVersion(self, ): + def getServerVersion(self,): self.send_getServerVersion() return self.recv_getServerVersion() - def send_getServerVersion(self, ): + def send_getServerVersion(self,): self._oprot.writeMessageBegin('getServerVersion', TMessageType.CALL, self._seqid) args = getServerVersion_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getServerVersion(self, ): + def recv_getServerVersion(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -698,18 +698,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getServerVersion failed: unknown result"); - def kill(self, ): + def kill(self,): self.send_kill() self.recv_kill() - def send_kill(self, ): + def send_kill(self,): self._oprot.writeMessageBegin('kill', TMessageType.CALL, self._seqid) args = kill_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_kill(self, ): + def recv_kill(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -721,18 +721,18 @@ class Client(Iface): self._iprot.readMessageEnd() return - def restart(self, ): + def restart(self,): self.send_restart() self.recv_restart() - def send_restart(self, ): + def send_restart(self,): self._oprot.writeMessageBegin('restart', TMessageType.CALL, self._seqid) args = restart_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_restart(self, ): + def recv_restart(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -760,7 +760,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getLog(self, ): + def recv_getLog(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -774,18 +774,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getLog failed: unknown result"); - def isTimeDownload(self, ): + def isTimeDownload(self,): self.send_isTimeDownload() return self.recv_isTimeDownload() - def send_isTimeDownload(self, ): + def send_isTimeDownload(self,): self._oprot.writeMessageBegin('isTimeDownload', TMessageType.CALL, self._seqid) args = isTimeDownload_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_isTimeDownload(self, ): + def recv_isTimeDownload(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -799,18 +799,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "isTimeDownload failed: unknown result"); - def isTimeReconnect(self, ): + def isTimeReconnect(self,): self.send_isTimeReconnect() return self.recv_isTimeReconnect() - def send_isTimeReconnect(self, ): + def send_isTimeReconnect(self,): self._oprot.writeMessageBegin('isTimeReconnect', TMessageType.CALL, self._seqid) args = isTimeReconnect_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_isTimeReconnect(self, ): + def recv_isTimeReconnect(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -824,18 +824,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "isTimeReconnect failed: unknown result"); - def toggleReconnect(self, ): + def toggleReconnect(self,): self.send_toggleReconnect() return self.recv_toggleReconnect() - def send_toggleReconnect(self, ): + def send_toggleReconnect(self,): self._oprot.writeMessageBegin('toggleReconnect', TMessageType.CALL, self._seqid) args = toggleReconnect_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_toggleReconnect(self, ): + def recv_toggleReconnect(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -865,7 +865,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_generatePackages(self, ): + def recv_generatePackages(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -895,7 +895,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_checkURLs(self, ): + def recv_checkURLs(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -927,7 +927,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_parseURLs(self, ): + def recv_parseURLs(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -957,7 +957,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_checkOnlineStatus(self, ): + def recv_checkOnlineStatus(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -991,7 +991,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_checkOnlineStatusContainer(self, ): + def recv_checkOnlineStatusContainer(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1021,7 +1021,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pollResults(self, ): + def recv_pollResults(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1035,18 +1035,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "pollResults failed: unknown result"); - def statusDownloads(self, ): + def statusDownloads(self,): self.send_statusDownloads() return self.recv_statusDownloads() - def send_statusDownloads(self, ): + def send_statusDownloads(self,): self._oprot.writeMessageBegin('statusDownloads', TMessageType.CALL, self._seqid) args = statusDownloads_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_statusDownloads(self, ): + def recv_statusDownloads(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1076,7 +1076,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPackageData(self, ): + def recv_getPackageData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1108,7 +1108,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPackageInfo(self, ): + def recv_getPackageInfo(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1140,7 +1140,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getFileData(self, ): + def recv_getFileData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1156,18 +1156,18 @@ class Client(Iface): raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "getFileData failed: unknown result"); - def getQueue(self, ): + def getQueue(self,): self.send_getQueue() return self.recv_getQueue() - def send_getQueue(self, ): + def send_getQueue(self,): self._oprot.writeMessageBegin('getQueue', TMessageType.CALL, self._seqid) args = getQueue_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getQueue(self, ): + def recv_getQueue(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1181,18 +1181,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueue failed: unknown result"); - def getCollector(self, ): + def getCollector(self,): self.send_getCollector() return self.recv_getCollector() - def send_getCollector(self, ): + def send_getCollector(self,): self._oprot.writeMessageBegin('getCollector', TMessageType.CALL, self._seqid) args = getCollector_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getCollector(self, ): + def recv_getCollector(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1206,18 +1206,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getCollector failed: unknown result"); - def getQueueData(self, ): + def getQueueData(self,): self.send_getQueueData() return self.recv_getQueueData() - def send_getQueueData(self, ): + def send_getQueueData(self,): self._oprot.writeMessageBegin('getQueueData', TMessageType.CALL, self._seqid) args = getQueueData_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getQueueData(self, ): + def recv_getQueueData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1231,18 +1231,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueueData failed: unknown result"); - def getCollectorData(self, ): + def getCollectorData(self,): self.send_getCollectorData() return self.recv_getCollectorData() - def send_getCollectorData(self, ): + def send_getCollectorData(self,): self._oprot.writeMessageBegin('getCollectorData', TMessageType.CALL, self._seqid) args = getCollectorData_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getCollectorData(self, ): + def recv_getCollectorData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1272,7 +1272,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPackageOrder(self, ): + def recv_getPackageOrder(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1302,7 +1302,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getFileOrder(self, ): + def recv_getFileOrder(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1334,7 +1334,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_generateAndAddPackages(self, ): + def recv_generateAndAddPackages(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1368,7 +1368,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_addPackage(self, ): + def recv_addPackage(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1400,7 +1400,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_addFiles(self, ): + def recv_addFiles(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1430,7 +1430,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_uploadContainer(self, ): + def recv_uploadContainer(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1458,7 +1458,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteFiles(self, ): + def recv_deleteFiles(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1486,7 +1486,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deletePackages(self, ): + def recv_deletePackages(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1514,7 +1514,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pushToQueue(self, ): + def recv_pushToQueue(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1542,7 +1542,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pullFromQueue(self, ): + def recv_pullFromQueue(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1570,7 +1570,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_restartPackage(self, ): + def recv_restartPackage(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1598,7 +1598,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_restartFile(self, ): + def recv_restartFile(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1626,7 +1626,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_recheckPackage(self, ): + def recv_recheckPackage(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1638,18 +1638,18 @@ class Client(Iface): self._iprot.readMessageEnd() return - def stopAllDownloads(self, ): + def stopAllDownloads(self,): self.send_stopAllDownloads() self.recv_stopAllDownloads() - def send_stopAllDownloads(self, ): + def send_stopAllDownloads(self,): self._oprot.writeMessageBegin('stopAllDownloads', TMessageType.CALL, self._seqid) args = stopAllDownloads_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_stopAllDownloads(self, ): + def recv_stopAllDownloads(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1677,7 +1677,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_stopDownloads(self, ): + def recv_stopDownloads(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1707,7 +1707,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setPackageName(self, ): + def recv_setPackageName(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1737,7 +1737,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_movePackage(self, ): + def recv_movePackage(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1767,7 +1767,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_moveFiles(self, ): + def recv_moveFiles(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1797,7 +1797,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_orderPackage(self, ): + def recv_orderPackage(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1827,7 +1827,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_orderFile(self, ): + def recv_orderFile(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1857,7 +1857,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setPackageData(self, ): + def recv_setPackageData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1871,18 +1871,18 @@ class Client(Iface): raise result.e return - def deleteFinished(self, ): + def deleteFinished(self,): self.send_deleteFinished() return self.recv_deleteFinished() - def send_deleteFinished(self, ): + def send_deleteFinished(self,): self._oprot.writeMessageBegin('deleteFinished', TMessageType.CALL, self._seqid) args = deleteFinished_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteFinished(self, ): + def recv_deleteFinished(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1896,18 +1896,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteFinished failed: unknown result"); - def restartFailed(self, ): + def restartFailed(self,): self.send_restartFailed() self.recv_restartFailed() - def send_restartFailed(self, ): + def send_restartFailed(self,): self._oprot.writeMessageBegin('restartFailed', TMessageType.CALL, self._seqid) args = restartFailed_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_restartFailed(self, ): + def recv_restartFailed(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1935,7 +1935,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getEvents(self, ): + def recv_getEvents(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1965,7 +1965,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getAccounts(self, ): + def recv_getAccounts(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -1979,18 +1979,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getAccounts failed: unknown result"); - def getAccountTypes(self, ): + def getAccountTypes(self,): self.send_getAccountTypes() return self.recv_getAccountTypes() - def send_getAccountTypes(self, ): + def send_getAccountTypes(self,): self._oprot.writeMessageBegin('getAccountTypes', TMessageType.CALL, self._seqid) args = getAccountTypes_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getAccountTypes(self, ): + def recv_getAccountTypes(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2026,7 +2026,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_updateAccount(self, ): + def recv_updateAccount(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2056,7 +2056,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_removeAccount(self, ): + def recv_removeAccount(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2086,7 +2086,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_login(self, ): + def recv_login(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2118,7 +2118,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getUserData(self, ): + def recv_getUserData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2132,18 +2132,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserData failed: unknown result"); - def getAllUserData(self, ): + def getAllUserData(self,): self.send_getAllUserData() return self.recv_getAllUserData() - def send_getAllUserData(self, ): + def send_getAllUserData(self,): self._oprot.writeMessageBegin('getAllUserData', TMessageType.CALL, self._seqid) args = getAllUserData_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getAllUserData(self, ): + def recv_getAllUserData(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2157,18 +2157,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUserData failed: unknown result"); - def getServices(self, ): + def getServices(self,): self.send_getServices() return self.recv_getServices() - def send_getServices(self, ): + def send_getServices(self,): self._oprot.writeMessageBegin('getServices', TMessageType.CALL, self._seqid) args = getServices_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getServices(self, ): + def recv_getServices(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2200,7 +2200,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_hasService(self, ): + def recv_hasService(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2230,7 +2230,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_call(self, ): + def recv_call(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2248,18 +2248,18 @@ class Client(Iface): raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "call failed: unknown result"); - def getAllInfo(self, ): + def getAllInfo(self,): self.send_getAllInfo() return self.recv_getAllInfo() - def send_getAllInfo(self, ): + def send_getAllInfo(self,): self._oprot.writeMessageBegin('getAllInfo', TMessageType.CALL, self._seqid) args = getAllInfo_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getAllInfo(self, ): + def recv_getAllInfo(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2289,7 +2289,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getInfoByPlugin(self, ): + def recv_getInfoByPlugin(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2303,18 +2303,18 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getInfoByPlugin failed: unknown result"); - def isCaptchaWaiting(self, ): + def isCaptchaWaiting(self,): self.send_isCaptchaWaiting() return self.recv_isCaptchaWaiting() - def send_isCaptchaWaiting(self, ): + def send_isCaptchaWaiting(self,): self._oprot.writeMessageBegin('isCaptchaWaiting', TMessageType.CALL, self._seqid) args = isCaptchaWaiting_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_isCaptchaWaiting(self, ): + def recv_isCaptchaWaiting(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2344,7 +2344,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getCaptchaTask(self, ): + def recv_getCaptchaTask(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2374,7 +2374,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getCaptchaTaskStatus(self, ): + def recv_getCaptchaTaskStatus(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -2406,7 +2406,7 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setCaptchaResult(self, ): + def recv_setCaptchaResult(self,): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() @@ -3315,9 +3315,9 @@ class getConfigValue_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'category', None, None, ), # 1 - (2, TType.STRING, 'option', None, None, ), # 2 - (3, TType.STRING, 'section', None, None, ), # 3 + (1, TType.STRING, 'category', None, None,), # 1 + (2, TType.STRING, 'option', None, None,), # 2 + (3, TType.STRING, 'section', None, None,), # 3 ) def __init__(self, category=None, option=None, section=None,): @@ -3337,7 +3337,7 @@ class getConfigValue_result(TBase): ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 + (0, TType.STRING, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3362,10 +3362,10 @@ class setConfigValue_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'category', None, None, ), # 1 - (2, TType.STRING, 'option', None, None, ), # 2 - (3, TType.STRING, 'value', None, None, ), # 3 - (4, TType.STRING, 'section', None, None, ), # 4 + (1, TType.STRING, 'category', None, None,), # 1 + (2, TType.STRING, 'option', None, None,), # 2 + (3, TType.STRING, 'value', None, None,), # 3 + (4, TType.STRING, 'section', None, None,), # 4 ) def __init__(self, category=None, option=None, value=None, section=None,): @@ -3404,7 +3404,7 @@ class getConfig_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ConfigSection, ConfigSection.thrift_spec)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.STRUCT, (ConfigSection, ConfigSection.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -3431,7 +3431,7 @@ class getPluginConfig_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ConfigSection, ConfigSection.thrift_spec)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.STRUCT, (ConfigSection, ConfigSection.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -3494,7 +3494,7 @@ class togglePause_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3521,7 +3521,7 @@ class statusServer_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (ServerStatus, ServerStatus.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (ServerStatus, ServerStatus.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -3548,7 +3548,7 @@ class freeSpace_result(TBase): ] thrift_spec = ( - (0, TType.I64, 'success', None, None, ), # 0 + (0, TType.I64, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3575,7 +3575,7 @@ class getServerVersion_result(TBase): ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 + (0, TType.STRING, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3630,7 +3630,7 @@ class getLog_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'offset', None, None, ), # 1 + (1, TType.I32, 'offset', None, None,), # 1 ) def __init__(self, offset=None,): @@ -3648,7 +3648,7 @@ class getLog_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRING, None), None,), # 0 ) def __init__(self, success=None,): @@ -3675,7 +3675,7 @@ class isTimeDownload_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3702,7 +3702,7 @@ class isTimeReconnect_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3729,7 +3729,7 @@ class toggleReconnect_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -3748,7 +3748,7 @@ class generatePackages_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'links', (TType.STRING,None), None, ), # 1 + (1, TType.LIST, 'links', (TType.STRING, None), None,), # 1 ) def __init__(self, links=None,): @@ -3766,7 +3766,7 @@ class generatePackages_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRING,None)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.LIST, (TType.STRING, None)), None,), # 0 ) def __init__(self, success=None,): @@ -3785,7 +3785,7 @@ class checkURLs_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'urls', (TType.STRING,None), None, ), # 1 + (1, TType.LIST, 'urls', (TType.STRING, None), None,), # 1 ) def __init__(self, urls=None,): @@ -3803,7 +3803,7 @@ class checkURLs_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRING,None)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.LIST, (TType.STRING, None)), None,), # 0 ) def __init__(self, success=None,): @@ -3824,8 +3824,8 @@ class parseURLs_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'html', None, None, ), # 1 - (2, TType.STRING, 'url', None, None, ), # 2 + (1, TType.STRING, 'html', None, None,), # 1 + (2, TType.STRING, 'url', None, None,), # 2 ) def __init__(self, html=None, url=None,): @@ -3844,7 +3844,7 @@ class parseURLs_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRING,None)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.LIST, (TType.STRING, None)), None,), # 0 ) def __init__(self, success=None,): @@ -3863,7 +3863,7 @@ class checkOnlineStatus_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'urls', (TType.STRING,None), None, ), # 1 + (1, TType.LIST, 'urls', (TType.STRING, None), None,), # 1 ) def __init__(self, urls=None,): @@ -3881,7 +3881,7 @@ class checkOnlineStatus_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -3904,9 +3904,9 @@ class checkOnlineStatusContainer_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'urls', (TType.STRING,None), None, ), # 1 - (2, TType.STRING, 'filename', None, None, ), # 2 - (3, TType.STRING, 'data', None, None, ), # 3 + (1, TType.LIST, 'urls', (TType.STRING, None), None,), # 1 + (2, TType.STRING, 'filename', None, None,), # 2 + (3, TType.STRING, 'data', None, None,), # 3 ) def __init__(self, urls=None, filename=None, data=None,): @@ -3926,7 +3926,7 @@ class checkOnlineStatusContainer_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -3945,7 +3945,7 @@ class pollResults_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'rid', None, None, ), # 1 + (1, TType.I32, 'rid', None, None,), # 1 ) def __init__(self, rid=None,): @@ -3963,7 +3963,7 @@ class pollResults_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -3990,7 +3990,7 @@ class statusDownloads_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(DownloadInfo, DownloadInfo.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (DownloadInfo, DownloadInfo.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4009,7 +4009,7 @@ class getPackageData_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4029,8 +4029,8 @@ class getPackageData_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1 + (0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None,), # 0 + (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None,), # 1 ) def __init__(self, success=None, e=None,): @@ -4050,7 +4050,7 @@ class getPackageInfo_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4070,8 +4070,8 @@ class getPackageInfo_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1 + (0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None,), # 0 + (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None,), # 1 ) def __init__(self, success=None, e=None,): @@ -4091,7 +4091,7 @@ class getFileData_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 + (1, TType.I32, 'fid', None, None,), # 1 ) def __init__(self, fid=None,): @@ -4111,8 +4111,8 @@ class getFileData_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (FileData, FileData.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (FileDoesNotExists, FileDoesNotExists.thrift_spec), None, ), # 1 + (0, TType.STRUCT, 'success', (FileData, FileData.thrift_spec), None,), # 0 + (1, TType.STRUCT, 'e', (FileDoesNotExists, FileDoesNotExists.thrift_spec), None,), # 1 ) def __init__(self, success=None, e=None,): @@ -4140,7 +4140,7 @@ class getQueue_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (PackageData, PackageData.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4167,7 +4167,7 @@ class getCollector_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (PackageData, PackageData.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4194,7 +4194,7 @@ class getQueueData_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (PackageData, PackageData.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4221,7 +4221,7 @@ class getCollectorData_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (PackageData, PackageData.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4240,7 +4240,7 @@ class getPackageOrder_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'destination', None, None, ), # 1 + (1, TType.I32, 'destination', None, None,), # 1 ) def __init__(self, destination=None,): @@ -4258,7 +4258,7 @@ class getPackageOrder_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 + (0, TType.MAP, 'success', (TType.I16, None, TType.I32, None), None,), # 0 ) def __init__(self, success=None,): @@ -4277,7 +4277,7 @@ class getFileOrder_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4295,7 +4295,7 @@ class getFileOrder_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 + (0, TType.MAP, 'success', (TType.I16, None, TType.I32, None), None,), # 0 ) def __init__(self, success=None,): @@ -4316,8 +4316,8 @@ class generateAndAddPackages_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'links', (TType.STRING,None), None, ), # 1 - (2, TType.I32, 'dest', None, None, ), # 2 + (1, TType.LIST, 'links', (TType.STRING, None), None,), # 1 + (2, TType.I32, 'dest', None, None,), # 2 ) def __init__(self, links=None, dest=None,): @@ -4336,7 +4336,7 @@ class generateAndAddPackages_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.I32,None), None, ), # 0 + (0, TType.LIST, 'success', (TType.I32, None), None,), # 0 ) def __init__(self, success=None,): @@ -4359,9 +4359,9 @@ class addPackage_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.LIST, 'links', (TType.STRING,None), None, ), # 2 - (3, TType.I32, 'dest', None, None, ), # 3 + (1, TType.STRING, 'name', None, None,), # 1 + (2, TType.LIST, 'links', (TType.STRING, None), None,), # 2 + (3, TType.I32, 'dest', None, None,), # 3 ) def __init__(self, name=None, links=None, dest=None,): @@ -4381,7 +4381,7 @@ class addPackage_result(TBase): ] thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 + (0, TType.I32, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -4402,8 +4402,8 @@ class addFiles_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.LIST, 'links', (TType.STRING,None), None, ), # 2 + (1, TType.I32, 'pid', None, None,), # 1 + (2, TType.LIST, 'links', (TType.STRING, None), None,), # 2 ) def __init__(self, pid=None, links=None,): @@ -4434,8 +4434,8 @@ class uploadContainer_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'filename', None, None, ), # 1 - (2, TType.STRING, 'data', None, None, ), # 2 + (1, TType.STRING, 'filename', None, None,), # 1 + (2, TType.STRING, 'data', None, None,), # 2 ) def __init__(self, filename=None, data=None,): @@ -4464,7 +4464,7 @@ class deleteFiles_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'fids', (TType.I32,None), None, ), # 1 + (1, TType.LIST, 'fids', (TType.I32, None), None,), # 1 ) def __init__(self, fids=None,): @@ -4492,7 +4492,7 @@ class deletePackages_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'pids', (TType.I32,None), None, ), # 1 + (1, TType.LIST, 'pids', (TType.I32, None), None,), # 1 ) def __init__(self, pids=None,): @@ -4520,7 +4520,7 @@ class pushToQueue_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4548,7 +4548,7 @@ class pullFromQueue_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4576,7 +4576,7 @@ class restartPackage_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4604,7 +4604,7 @@ class restartFile_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 + (1, TType.I32, 'fid', None, None,), # 1 ) def __init__(self, fid=None,): @@ -4632,7 +4632,7 @@ class recheckPackage_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -4678,7 +4678,7 @@ class stopDownloads_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'fids', (TType.I32,None), None, ), # 1 + (1, TType.LIST, 'fids', (TType.I32, None), None,), # 1 ) def __init__(self, fids=None,): @@ -4708,8 +4708,8 @@ class setPackageName_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 + (1, TType.I32, 'pid', None, None,), # 1 + (2, TType.STRING, 'name', None, None,), # 2 ) def __init__(self, pid=None, name=None,): @@ -4740,8 +4740,8 @@ class movePackage_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'destination', None, None, ), # 1 - (2, TType.I32, 'pid', None, None, ), # 2 + (1, TType.I32, 'destination', None, None,), # 1 + (2, TType.I32, 'pid', None, None,), # 2 ) def __init__(self, destination=None, pid=None,): @@ -4772,8 +4772,8 @@ class moveFiles_args(TBase): thrift_spec = ( None, # 0 - (1, TType.LIST, 'fids', (TType.I32,None), None, ), # 1 - (2, TType.I32, 'pid', None, None, ), # 2 + (1, TType.LIST, 'fids', (TType.I32, None), None,), # 1 + (2, TType.I32, 'pid', None, None,), # 2 ) def __init__(self, fids=None, pid=None,): @@ -4804,8 +4804,8 @@ class orderPackage_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.I16, 'position', None, None, ), # 2 + (1, TType.I32, 'pid', None, None,), # 1 + (2, TType.I16, 'position', None, None,), # 2 ) def __init__(self, pid=None, position=None,): @@ -4836,8 +4836,8 @@ class orderFile_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 - (2, TType.I16, 'position', None, None, ), # 2 + (1, TType.I32, 'fid', None, None,), # 1 + (2, TType.I16, 'position', None, None,), # 2 ) def __init__(self, fid=None, position=None,): @@ -4868,8 +4868,8 @@ class setPackageData_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.MAP, 'data', (TType.STRING,None,TType.STRING,None), None, ), # 2 + (1, TType.I32, 'pid', None, None,), # 1 + (2, TType.MAP, 'data', (TType.STRING, None, TType.STRING, None), None,), # 2 ) def __init__(self, pid=None, data=None,): @@ -4889,7 +4889,7 @@ class setPackageData_result(TBase): thrift_spec = ( None, # 0 - (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1 + (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None,), # 1 ) def __init__(self, e=None,): @@ -4916,7 +4916,7 @@ class deleteFinished_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.I32,None), None, ), # 0 + (0, TType.LIST, 'success', (TType.I32, None), None,), # 0 ) def __init__(self, success=None,): @@ -4953,7 +4953,7 @@ class getEvents_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'uuid', None, None, ), # 1 + (1, TType.STRING, 'uuid', None, None,), # 1 ) def __init__(self, uuid=None,): @@ -4971,7 +4971,7 @@ class getEvents_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(EventInfo, EventInfo.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (EventInfo, EventInfo.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -4990,7 +4990,7 @@ class getAccounts_args(TBase): thrift_spec = ( None, # 0 - (1, TType.BOOL, 'refresh', None, None, ), # 1 + (1, TType.BOOL, 'refresh', None, None,), # 1 ) def __init__(self, refresh=None,): @@ -5008,7 +5008,7 @@ class getAccounts_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(AccountInfo, AccountInfo.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT, (AccountInfo, AccountInfo.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -5035,7 +5035,7 @@ class getAccountTypes_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRING, None), None,), # 0 ) def __init__(self, success=None,): @@ -5060,10 +5060,10 @@ class updateAccount_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'account', None, None, ), # 2 - (3, TType.STRING, 'password', None, None, ), # 3 - (4, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 4 + (1, TType.STRING, 'plugin', None, None,), # 1 + (2, TType.STRING, 'account', None, None,), # 2 + (3, TType.STRING, 'password', None, None,), # 3 + (4, TType.MAP, 'options', (TType.STRING, None, TType.STRING, None), None,), # 4 ) def __init__(self, plugin=None, account=None, password=None, options=None,): @@ -5096,8 +5096,8 @@ class removeAccount_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'account', None, None, ), # 2 + (1, TType.STRING, 'plugin', None, None,), # 1 + (2, TType.STRING, 'account', None, None,), # 2 ) def __init__(self, plugin=None, account=None,): @@ -5128,8 +5128,8 @@ class login_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'username', None, None, ), # 1 - (2, TType.STRING, 'password', None, None, ), # 2 + (1, TType.STRING, 'username', None, None,), # 1 + (2, TType.STRING, 'password', None, None,), # 2 ) def __init__(self, username=None, password=None,): @@ -5148,7 +5148,7 @@ class login_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -5169,8 +5169,8 @@ class getUserData_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'username', None, None, ), # 1 - (2, TType.STRING, 'password', None, None, ), # 2 + (1, TType.STRING, 'username', None, None,), # 1 + (2, TType.STRING, 'password', None, None,), # 2 ) def __init__(self, username=None, password=None,): @@ -5189,7 +5189,7 @@ class getUserData_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (UserData, UserData.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (UserData, UserData.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -5216,7 +5216,7 @@ class getAllUserData_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(UserData, UserData.thrift_spec)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.STRUCT, (UserData, UserData.thrift_spec)), None,), # 0 ) def __init__(self, success=None,): @@ -5243,7 +5243,7 @@ class getServices_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.STRING,None)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.MAP, (TType.STRING, None, TType.STRING, None)), None,), # 0 ) def __init__(self, success=None,): @@ -5264,8 +5264,8 @@ class hasService_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'func', None, None, ), # 2 + (1, TType.STRING, 'plugin', None, None,), # 1 + (2, TType.STRING, 'func', None, None,), # 2 ) def __init__(self, plugin=None, func=None,): @@ -5284,7 +5284,7 @@ class hasService_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -5303,7 +5303,7 @@ class call_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRUCT, 'info', (ServiceCall, ServiceCall.thrift_spec), None, ), # 1 + (1, TType.STRUCT, 'info', (ServiceCall, ServiceCall.thrift_spec), None,), # 1 ) def __init__(self, info=None,): @@ -5325,9 +5325,9 @@ class call_result(TBase): ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ex', (ServiceDoesNotExists, ServiceDoesNotExists.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'e', (ServiceException, ServiceException.thrift_spec), None, ), # 2 + (0, TType.STRING, 'success', None, None,), # 0 + (1, TType.STRUCT, 'ex', (ServiceDoesNotExists, ServiceDoesNotExists.thrift_spec), None,), # 1 + (2, TType.STRUCT, 'e', (ServiceException, ServiceException.thrift_spec), None,), # 2 ) def __init__(self, success=None, ex=None, e=None,): @@ -5356,7 +5356,7 @@ class getAllInfo_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.STRING,None)), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.MAP, (TType.STRING, None, TType.STRING, None)), None,), # 0 ) def __init__(self, success=None,): @@ -5375,7 +5375,7 @@ class getInfoByPlugin_args(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 + (1, TType.STRING, 'plugin', None, None,), # 1 ) def __init__(self, plugin=None,): @@ -5393,7 +5393,7 @@ class getInfoByPlugin_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING, None, TType.STRING, None), None,), # 0 ) def __init__(self, success=None,): @@ -5420,7 +5420,7 @@ class isCaptchaWaiting_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.BOOL, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -5439,7 +5439,7 @@ class getCaptchaTask_args(TBase): thrift_spec = ( None, # 0 - (1, TType.BOOL, 'exclusive', None, None, ), # 1 + (1, TType.BOOL, 'exclusive', None, None,), # 1 ) def __init__(self, exclusive=None,): @@ -5457,7 +5457,7 @@ class getCaptchaTask_result(TBase): ] thrift_spec = ( - (0, TType.STRUCT, 'success', (CaptchaTask, CaptchaTask.thrift_spec), None, ), # 0 + (0, TType.STRUCT, 'success', (CaptchaTask, CaptchaTask.thrift_spec), None,), # 0 ) def __init__(self, success=None,): @@ -5476,7 +5476,7 @@ class getCaptchaTaskStatus_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'tid', None, None, ), # 1 + (1, TType.I32, 'tid', None, None,), # 1 ) def __init__(self, tid=None,): @@ -5494,7 +5494,7 @@ class getCaptchaTaskStatus_result(TBase): ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 + (0, TType.STRING, 'success', None, None,), # 0 ) def __init__(self, success=None,): @@ -5515,8 +5515,8 @@ class setCaptchaResult_args(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'tid', None, None, ), # 1 - (2, TType.STRING, 'result', None, None, ), # 2 + (1, TType.I32, 'tid', None, None,), # 1 + (2, TType.STRING, 'result', None, None,), # 2 ) def __init__(self, tid=None, result=None,): diff --git a/module/remote/thriftbackend/thriftgen/pyload/constants.py b/module/remote/thriftbackend/thriftgen/pyload/constants.py index d1f015464..3bdd64cc1 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/constants.py +++ b/module/remote/thriftbackend/thriftgen/pyload/constants.py @@ -3,7 +3,7 @@ # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # -# options string: py:slots,dynamic +# options string: py:slots, dynamic # from thrift.Thrift import TType, TMessageType, TException diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index 58fff20ad..c2c50924e 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -3,7 +3,7 @@ # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # -# options string: py:slots,dynamic +# options string: py:slots, dynamic # from thrift.Thrift import TType, TMessageType, TException @@ -190,22 +190,22 @@ class DownloadInfo(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 - (3, TType.I64, 'speed', None, None, ), # 3 - (4, TType.I32, 'eta', None, None, ), # 4 - (5, TType.STRING, 'format_eta', None, None, ), # 5 - (6, TType.I64, 'bleft', None, None, ), # 6 - (7, TType.I64, 'size', None, None, ), # 7 - (8, TType.STRING, 'format_size', None, None, ), # 8 - (9, TType.BYTE, 'percent', None, None, ), # 9 - (10, TType.I32, 'status', None, None, ), # 10 - (11, TType.STRING, 'statusmsg', None, None, ), # 11 - (12, TType.STRING, 'format_wait', None, None, ), # 12 - (13, TType.I64, 'wait_until', None, None, ), # 13 - (14, TType.I32, 'packageID', None, None, ), # 14 - (15, TType.STRING, 'packageName', None, None, ), # 15 - (16, TType.STRING, 'plugin', None, None, ), # 16 + (1, TType.I32, 'fid', None, None,), # 1 + (2, TType.STRING, 'name', None, None,), # 2 + (3, TType.I64, 'speed', None, None,), # 3 + (4, TType.I32, 'eta', None, None,), # 4 + (5, TType.STRING, 'format_eta', None, None,), # 5 + (6, TType.I64, 'bleft', None, None,), # 6 + (7, TType.I64, 'size', None, None,), # 7 + (8, TType.STRING, 'format_size', None, None,), # 8 + (9, TType.BYTE, 'percent', None, None,), # 9 + (10, TType.I32, 'status', None, None,), # 10 + (11, TType.STRING, 'statusmsg', None, None,), # 11 + (12, TType.STRING, 'format_wait', None, None,), # 12 + (13, TType.I64, 'wait_until', None, None,), # 13 + (14, TType.I32, 'packageID', None, None,), # 14 + (15, TType.STRING, 'packageName', None, None,), # 15 + (16, TType.STRING, 'plugin', None, None,), # 16 ) def __init__(self, fid=None, name=None, speed=None, eta=None, format_eta=None, bleft=None, size=None, format_size=None, percent=None, status=None, statusmsg=None, format_wait=None, wait_until=None, packageID=None, packageName=None, plugin=None,): @@ -251,13 +251,13 @@ class ServerStatus(TBase): thrift_spec = ( None, # 0 - (1, TType.BOOL, 'pause', None, None, ), # 1 - (2, TType.I16, 'active', None, None, ), # 2 - (3, TType.I16, 'queue', None, None, ), # 3 - (4, TType.I16, 'total', None, None, ), # 4 - (5, TType.I64, 'speed', None, None, ), # 5 - (6, TType.BOOL, 'download', None, None, ), # 6 - (7, TType.BOOL, 'reconnect', None, None, ), # 7 + (1, TType.BOOL, 'pause', None, None,), # 1 + (2, TType.I16, 'active', None, None,), # 2 + (3, TType.I16, 'queue', None, None,), # 3 + (4, TType.I16, 'total', None, None,), # 4 + (5, TType.I64, 'speed', None, None,), # 5 + (6, TType.BOOL, 'download', None, None,), # 6 + (7, TType.BOOL, 'reconnect', None, None,), # 7 ) def __init__(self, pause=None, active=None, queue=None, total=None, speed=None, download=None, reconnect=None,): @@ -288,10 +288,10 @@ class ConfigItem(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'description', None, None, ), # 2 - (3, TType.STRING, 'value', None, None, ), # 3 - (4, TType.STRING, 'type', None, None, ), # 4 + (1, TType.STRING, 'name', None, None,), # 1 + (2, TType.STRING, 'description', None, None,), # 2 + (3, TType.STRING, 'value', None, None,), # 3 + (4, TType.STRING, 'type', None, None,), # 4 ) def __init__(self, name=None, description=None, value=None, type=None,): @@ -319,10 +319,10 @@ class ConfigSection(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'description', None, None, ), # 2 - (3, TType.LIST, 'items', (TType.STRUCT,(ConfigItem, ConfigItem.thrift_spec)), None, ), # 3 - (4, TType.STRING, 'outline', None, None, ), # 4 + (1, TType.STRING, 'name', None, None,), # 1 + (2, TType.STRING, 'description', None, None,), # 2 + (3, TType.LIST, 'items', (TType.STRUCT, (ConfigItem, ConfigItem.thrift_spec)), None,), # 3 + (4, TType.STRING, 'outline', None, None,), # 4 ) def __init__(self, name=None, description=None, items=None, outline=None,): @@ -364,17 +364,17 @@ class FileData(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 - (2, TType.STRING, 'url', None, None, ), # 2 - (3, TType.STRING, 'name', None, None, ), # 3 - (4, TType.STRING, 'plugin', None, None, ), # 4 - (5, TType.I64, 'size', None, None, ), # 5 - (6, TType.STRING, 'format_size', None, None, ), # 6 - (7, TType.I32, 'status', None, None, ), # 7 - (8, TType.STRING, 'statusmsg', None, None, ), # 8 - (9, TType.I32, 'packageID', None, None, ), # 9 - (10, TType.STRING, 'error', None, None, ), # 10 - (11, TType.I16, 'order', None, None, ), # 11 + (1, TType.I32, 'fid', None, None,), # 1 + (2, TType.STRING, 'url', None, None,), # 2 + (3, TType.STRING, 'name', None, None,), # 3 + (4, TType.STRING, 'plugin', None, None,), # 4 + (5, TType.I64, 'size', None, None,), # 5 + (6, TType.STRING, 'format_size', None, None,), # 6 + (7, TType.I32, 'status', None, None,), # 7 + (8, TType.STRING, 'statusmsg', None, None,), # 8 + (9, TType.I32, 'packageID', None, None,), # 9 + (10, TType.STRING, 'error', None, None,), # 10 + (11, TType.I16, 'order', None, None,), # 11 ) def __init__(self, fid=None, url=None, name=None, plugin=None, size=None, format_size=None, status=None, statusmsg=None, packageID=None, error=None, order=None,): @@ -427,19 +427,19 @@ class PackageData(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 - (3, TType.STRING, 'folder', None, None, ), # 3 - (4, TType.STRING, 'site', None, None, ), # 4 - (5, TType.STRING, 'password', None, None, ), # 5 - (6, TType.I32, 'dest', None, None, ), # 6 - (7, TType.I16, 'order', None, None, ), # 7 - (8, TType.I16, 'linksdone', None, None, ), # 8 - (9, TType.I64, 'sizedone', None, None, ), # 9 - (10, TType.I64, 'sizetotal', None, None, ), # 10 - (11, TType.I16, 'linkstotal', None, None, ), # 11 - (12, TType.LIST, 'links', (TType.STRUCT,(FileData, FileData.thrift_spec)), None, ), # 12 - (13, TType.LIST, 'fids', (TType.I32,None), None, ), # 13 + (1, TType.I32, 'pid', None, None,), # 1 + (2, TType.STRING, 'name', None, None,), # 2 + (3, TType.STRING, 'folder', None, None,), # 3 + (4, TType.STRING, 'site', None, None,), # 4 + (5, TType.STRING, 'password', None, None,), # 5 + (6, TType.I32, 'dest', None, None,), # 6 + (7, TType.I16, 'order', None, None,), # 7 + (8, TType.I16, 'linksdone', None, None,), # 8 + (9, TType.I64, 'sizedone', None, None,), # 9 + (10, TType.I64, 'sizetotal', None, None,), # 10 + (11, TType.I16, 'linkstotal', None, None,), # 11 + (12, TType.LIST, 'links', (TType.STRUCT, (FileData, FileData.thrift_spec)), None,), # 12 + (13, TType.LIST, 'fids', (TType.I32, None), None,), # 13 ) def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, linksdone=None, sizedone=None, sizetotal=None, linkstotal=None, links=None, fids=None,): @@ -486,15 +486,15 @@ class InteractionTask(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'iid', None, None, ), # 1 - (2, TType.I32, 'input', None, None, ), # 2 - (3, TType.LIST, 'structure', (TType.STRING,None), None, ), # 3 - (4, TType.LIST, 'preset', (TType.STRING,None), None, ), # 4 - (5, TType.I32, 'output', None, None, ), # 5 - (6, TType.LIST, 'data', (TType.STRING,None), None, ), # 6 - (7, TType.STRING, 'title', None, None, ), # 7 - (8, TType.STRING, 'description', None, None, ), # 8 - (9, TType.STRING, 'plugin', None, None, ), # 9 + (1, TType.I32, 'iid', None, None,), # 1 + (2, TType.I32, 'input', None, None,), # 2 + (3, TType.LIST, 'structure', (TType.STRING, None), None,), # 3 + (4, TType.LIST, 'preset', (TType.STRING, None), None,), # 4 + (5, TType.I32, 'output', None, None,), # 5 + (6, TType.LIST, 'data', (TType.STRING, None), None,), # 6 + (7, TType.STRING, 'title', None, None,), # 7 + (8, TType.STRING, 'description', None, None,), # 8 + (9, TType.STRING, 'plugin', None, None,), # 9 ) def __init__(self, iid=None, input=None, structure=None, preset=None, output=None, data=None, title=None, description=None, plugin=None,): @@ -527,10 +527,10 @@ class CaptchaTask(TBase): thrift_spec = ( None, # 0 - (1, TType.I16, 'tid', None, None, ), # 1 - (2, TType.STRING, 'data', None, None, ), # 2 - (3, TType.STRING, 'type', None, None, ), # 3 - (4, TType.STRING, 'resultType', None, None, ), # 4 + (1, TType.I16, 'tid', None, None,), # 1 + (2, TType.STRING, 'data', None, None,), # 2 + (3, TType.STRING, 'type', None, None,), # 3 + (4, TType.STRING, 'resultType', None, None,), # 4 ) def __init__(self, tid=None, data=None, type=None, resultType=None,): @@ -558,10 +558,10 @@ class EventInfo(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'eventname', None, None, ), # 1 - (2, TType.I32, 'id', None, None, ), # 2 - (3, TType.I32, 'type', None, None, ), # 3 - (4, TType.I32, 'destination', None, None, ), # 4 + (1, TType.STRING, 'eventname', None, None,), # 1 + (2, TType.I32, 'id', None, None,), # 2 + (3, TType.I32, 'type', None, None,), # 3 + (4, TType.I32, 'destination', None, None,), # 4 ) def __init__(self, eventname=None, id=None, type=None, destination=None,): @@ -591,11 +591,11 @@ class UserData(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'email', None, None, ), # 2 - (3, TType.I32, 'role', None, None, ), # 3 - (4, TType.I32, 'permission', None, None, ), # 4 - (5, TType.STRING, 'templateName', None, None, ), # 5 + (1, TType.STRING, 'name', None, None,), # 1 + (2, TType.STRING, 'email', None, None,), # 2 + (3, TType.I32, 'role', None, None,), # 3 + (4, TType.I32, 'permission', None, None,), # 4 + (5, TType.STRING, 'templateName', None, None,), # 5 ) def __init__(self, name=None, email=None, role=None, permission=None, templateName=None,): @@ -632,14 +632,14 @@ class AccountInfo(TBase): thrift_spec = ( None, # 0 - (1, TType.I64, 'validuntil', None, None, ), # 1 - (2, TType.STRING, 'login', None, None, ), # 2 - (3, TType.MAP, 'options', (TType.STRING,None,TType.LIST,(TType.STRING,None)), None, ), # 3 - (4, TType.BOOL, 'valid', None, None, ), # 4 - (5, TType.I64, 'trafficleft', None, None, ), # 5 - (6, TType.I64, 'maxtraffic', None, None, ), # 6 - (7, TType.BOOL, 'premium', None, None, ), # 7 - (8, TType.STRING, 'type', None, None, ), # 8 + (1, TType.I64, 'validuntil', None, None,), # 1 + (2, TType.STRING, 'login', None, None,), # 2 + (3, TType.MAP, 'options', (TType.STRING, None, TType.LIST, (TType.STRING, None)), None,), # 3 + (4, TType.BOOL, 'valid', None, None,), # 4 + (5, TType.I64, 'trafficleft', None, None,), # 5 + (6, TType.I64, 'maxtraffic', None, None,), # 6 + (7, TType.BOOL, 'premium', None, None,), # 7 + (8, TType.STRING, 'type', None, None,), # 8 ) def __init__(self, validuntil=None, login=None, options=None, valid=None, trafficleft=None, maxtraffic=None, premium=None, type=None,): @@ -671,10 +671,10 @@ class ServiceCall(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'func', None, None, ), # 2 - (3, TType.LIST, 'arguments', (TType.STRING,None), None, ), # 3 - (4, TType.BOOL, 'parseArguments', None, None, ), # 4 + (1, TType.STRING, 'plugin', None, None,), # 1 + (2, TType.STRING, 'func', None, None,), # 2 + (3, TType.LIST, 'arguments', (TType.STRING, None), None,), # 3 + (4, TType.BOOL, 'parseArguments', None, None,), # 4 ) def __init__(self, plugin=None, func=None, arguments=None, parseArguments=None,): @@ -704,11 +704,11 @@ class OnlineStatus(TBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'plugin', None, None, ), # 2 - (3, TType.STRING, 'packagename', None, None, ), # 3 - (4, TType.I32, 'status', None, None, ), # 4 - (5, TType.I64, 'size', None, None, ), # 5 + (1, TType.STRING, 'name', None, None,), # 1 + (2, TType.STRING, 'plugin', None, None,), # 2 + (3, TType.STRING, 'packagename', None, None,), # 3 + (4, TType.I32, 'status', None, None,), # 4 + (5, TType.I64, 'size', None, None,), # 5 ) def __init__(self, name=None, plugin=None, packagename=None, status=None, size=None,): @@ -733,8 +733,8 @@ class OnlineCheck(TBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'rid', None, None, ), # 1 - (2, TType.MAP, 'data', (TType.STRING,None,TType.STRUCT,(OnlineStatus, OnlineStatus.thrift_spec)), None, ), # 2 + (1, TType.I32, 'rid', None, None,), # 1 + (2, TType.MAP, 'data', (TType.STRING, None, TType.STRUCT, (OnlineStatus, OnlineStatus.thrift_spec)), None,), # 2 ) def __init__(self, rid=None, data=None,): @@ -754,7 +754,7 @@ class PackageDoesNotExists(TExceptionBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 + (1, TType.I32, 'pid', None, None,), # 1 ) def __init__(self, pid=None,): @@ -776,7 +776,7 @@ class FileDoesNotExists(TExceptionBase): thrift_spec = ( None, # 0 - (1, TType.I32, 'fid', None, None, ), # 1 + (1, TType.I32, 'fid', None, None,), # 1 ) def __init__(self, fid=None,): @@ -800,8 +800,8 @@ class ServiceDoesNotExists(TExceptionBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'func', None, None, ), # 2 + (1, TType.STRING, 'plugin', None, None,), # 1 + (2, TType.STRING, 'func', None, None,), # 2 ) def __init__(self, plugin=None, func=None,): @@ -824,7 +824,7 @@ class ServiceException(TExceptionBase): thrift_spec = ( None, # 0 - (1, TType.STRING, 'msg', None, None, ), # 1 + (1, TType.STRING, 'msg', None, None,), # 1 ) def __init__(self, msg=None,): diff --git a/module/setup.py b/module/setup.py index 67ac82e4f..aa7d9db51 100644 --- a/module/setup.py +++ b/module/setup.py @@ -489,10 +489,10 @@ class Setup(): input = default if bool: - # yes, true,t are inputs for booleans with value true + # yes, true, t are inputs for booleans with value true if input.lower().strip() in [self.yes, _("yes"), _("true"), _("t"), "yes"]: return True - # no, false,f are inputs for booleans with value false + # no, false, f are inputs for booleans with value false elif input.lower().strip() in [self.no, _("no"), _("false"), _("f"), "no"]: return False else: diff --git a/module/utils.py b/module/utils.py index 24e86ef2e..47047ccba 100644 --- a/module/utils.py +++ b/module/utils.py @@ -159,7 +159,7 @@ def parseFileSize(string, unit=None): #returns bytes def lock(func): def new(*args): - #print "Handler: %s args: %s" % (func,args[1:]) + #print "Handler: %s args: %s" % (func, args[1:]) args[0].lock.acquire() try: return func(*args) diff --git a/module/web/cnl_app.py b/module/web/cnl_app.py index d8f7c1180..0e6aaf907 100644 --- a/module/web/cnl_app.py +++ b/module/web/cnl_app.py @@ -100,7 +100,7 @@ def addcrypted2(): IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) - result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") + result = obj.decrypt(crypted).replace("\x00", "").replace("\r", "").split("\n") result = filter(lambda x: x != "", result) diff --git a/module/web/json_app.py b/module/web/json_app.py index 792fa8fe0..fc6cc4b7f 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -242,7 +242,7 @@ def load_config(category, section): conf = PYLOAD.getPluginConfigDict() for key, option in conf[section].iteritems(): - if key in ("desc","outline"): continue + if key in ("desc", "outline"): continue if ";" in option["type"]: option["list"] = option["type"].split(";") diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index 671fd5000..71adb66a6 100644 --- a/module/web/pyload_app.py +++ b/module/web/pyload_app.py @@ -389,7 +389,7 @@ def logs(item=-1): reversed = s.get('reversed', False) warning = "" - conf = PYLOAD.getConfigValue("log","file_log") + conf = PYLOAD.getConfigValue("log", "file_log") if not conf: warning = "Warning: File log is disabled, see settings page." diff --git a/module/web/templates/default/settings_item.html b/module/web/templates/default/settings_item.html index 28de1a1a9..6642d34b4 100644 --- a/module/web/templates/default/settings_item.html +++ b/module/web/templates/default/settings_item.html @@ -3,7 +3,7 @@ <tr><th colspan="2">{{ section.outline }}</th></tr> {% endif %} {% for okey, option in section.iteritems() %} - {% if okey not in ("desc","outline") %} + {% if okey not in ("desc", "outline") %} <tr> <td><label for="{{skey}}|{{okey}}" style="color:#424242;">{{ option.desc }}:</label></td> diff --git a/pavement.py b/pavement.py index 9abb51dc2..6016ab4e0 100644 --- a/pavement.py +++ b/pavement.py @@ -43,7 +43,7 @@ setup( include_package_data=True, exclude_package_data={'pyload': ['docs*', 'scripts*', 'tests*']}, #exluced from build but not from sdist # 'bottle >= 0.10.0' not in list, because its small and contain little modifications - install_requires=['thrift >= 0.8.0', 'jinja2', 'pycurl', 'Beaker', 'BeautifulSoup>=3.2, <3.3'] + extradeps, + install_requires=['thrift >= 0.8.0', 'jinja2', 'pycurl', 'Beaker', 'BeautifulSoup >= 3.2, < 3.3'] + extradeps, extras_require={ 'SSL': ["pyOpenSSL"], 'DLC': ['pycrypto'], @@ -169,7 +169,7 @@ def thrift(options): outdir = path("module") / "remote" / "thriftbackend" (outdir / "gen-py").rmtree() - cmd = [options.thrift.path, "-strict", "-o", outdir, "--gen", "py:slots,dynamic", outdir / "pyload.thrift"] + cmd = [options.thrift.path, "-strict", "-o", outdir, "--gen", "py:slots, dynamic", outdir / "pyload.thrift"] if options.gen: cmd.insert(len(cmd) - 1, "--gen") diff --git a/pyLoadCli.py b/pyLoadCli.py index 079cee19c..b790041a1 100755 --- a/pyLoadCli.py +++ b/pyLoadCli.py @@ -492,7 +492,7 @@ def main(): gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None]) translation = gettext.translation("pyLoadCli", join(pypath, "locale"), - languages=[config["language"],"en"],fallback=True) + languages=[config["language"], "en"], fallback=True) translation.install(unicode=True) interactive = False @@ -518,7 +518,7 @@ def main(): config["language"] = params gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None]) translation = gettext.translation("pyLoadCli", join(pypath, "locale"), - languages=[config["language"],"en"],fallback=True) + languages=[config["language"], "en"], fallback=True) translation.install(unicode=True) elif option in ("-h", "--help"): print_help(config) diff --git a/pyLoadCore.py b/pyLoadCore.py index 7311ec573..56e196497 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -292,7 +292,7 @@ class Core(object): gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None]) translation = gettext.translation("pyLoad", self.path("locale"), - languages=[self.config['general']['language'],"en"],fallback=True) + languages=[self.config['general']['language'], "en"], fallback=True) translation.install(True) self.debug = self.doDebug or self.config['general']['debug_mode'] @@ -567,7 +567,7 @@ class Core(object): self.shutdown() chdir(owd) # close some open fds - for i in range(3,50): + for i in range(3, 50): try: close(i) except : diff --git a/pyLoadGui.py b/pyLoadGui.py index a19053def..69df22a4f 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -586,7 +586,7 @@ class main(QObject): """ if self.checkClipboard: text = self.clipboard.text() - pattern = re.compile(r"(http|https|ftp)://[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?/.*)?") + pattern = re.compile(r"(http|https|ftp)://[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2, 5}(([0-9]{1, 5})?/.*)?") matches = pattern.finditer(text) # thanks to: jmansour //#139 |