diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 18:02:51 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 18:02:51 +0200 |
commit | 4e8fd1bfb7f77a7eba1880d61a60a70481a6341f (patch) | |
tree | b84736a8e5d329beaea0ecc5a47afb0471dc5e7b | |
parent | Other import fixes (4) (diff) | |
download | pyload-4e8fd1bfb7f77a7eba1880d61a60a70481a6341f.tar.xz |
Fix dict generators for python 2.5
-rw-r--r-- | pyload/Database/Storage.py | 2 | ||||
-rw-r--r-- | pyload/Database/User.py | 2 | ||||
-rw-r--r-- | pyload/plugin/crypter/YoutubeComFolder.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/NitroflareCom.py | 2 | ||||
-rw-r--r-- | pyload/webui/app/utils.py | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/pyload/Database/Storage.py b/pyload/Database/Storage.py index a19f67606..1d6922a89 100644 --- a/pyload/Database/Storage.py +++ b/pyload/Database/Storage.py @@ -25,7 +25,7 @@ class StorageMethods(object): return row[0] else: db.c.execute("SELECT key, value FROM storage WHERE identifier=?", (identifier,)) - return {row[0]: row[1] for row in db.c} + return dict((row[0], row[1]) for row in db.c) @style.queue diff --git a/pyload/Database/User.py b/pyload/Database/User.py index a91e16cc6..b895a4e12 100644 --- a/pyload/Database/User.py +++ b/pyload/Database/User.py @@ -82,7 +82,7 @@ class UserMethods(object): @style.queue def getAllUserData(db): db.c.execute("SELECT name, permission, role, template, email FROM users") - return {r[0]: {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]} for r in db.c} + return dict(r[0], {"permission": r[1], "role": r[2], "template": r[3], "email": r[4]}) for r in db.c) @style.queue diff --git a/pyload/plugin/crypter/YoutubeComFolder.py b/pyload/plugin/crypter/YoutubeComFolder.py index 6873c9148..3c971fea1 100644 --- a/pyload/plugin/crypter/YoutubeComFolder.py +++ b/pyload/plugin/crypter/YoutubeComFolder.py @@ -107,7 +107,7 @@ class YoutubeComFolder(Crypter): playlists = self.getPlaylists(channel['id']) self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), channel['title'])) - relatedplaylist = {p_name: self.getPlaylist(p_id) for p_name, p_id in channel['relatedPlaylists'].iteritems()} + relatedplaylist = dict((p_name, self.getPlaylist(p_id)) for p_name, p_id in channel['relatedPlaylists'].iteritems()) self.logDebug("Channel's related playlists found = %s" % relatedplaylist.keys()) relatedplaylist['uploads']['title'] = "Unplaylisted videos" diff --git a/pyload/plugin/hoster/NitroflareCom.py b/pyload/plugin/hoster/NitroflareCom.py index aed0b404f..5ebb83485 100644 --- a/pyload/plugin/hoster/NitroflareCom.py +++ b/pyload/plugin/hoster/NitroflareCom.py @@ -44,7 +44,7 @@ class NitroflareCom(SimpleHoster): elif hasattr(self, 'WAIT_PATTERN'): m = re.search(self.WAIT_PATTERN, self.html) if m: - wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in + wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1, "": 1}[u.lower()] for v, u in re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)) self.wait(wait_time, wait_time > 300) return diff --git a/pyload/webui/app/utils.py b/pyload/webui/app/utils.py index 2e7cf76c5..5663c6f58 100644 --- a/pyload/webui/app/utils.py +++ b/pyload/webui/app/utils.py @@ -112,7 +112,7 @@ def login_required(perm=None): def toDict(obj): - return {att: getattr(obj, att) for att in obj.__slots__} + return dict((att, getattr(obj, att)) for att in obj.__slots__) class CherryPyWSGI(ServerAdapter): |