diff options
author | fedeG <federicogonzalez761@gmail.com> | 2015-04-19 17:37:58 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-19 17:37:58 +0200 |
commit | ed7ba3c1f7552106148b014cbbf4a2642dcf4adc (patch) | |
tree | 8484a362d179640168e7a7d02b41447d39100c71 /pyload/database/Storage.py | |
parent | Use with statement (diff) | |
download | pyload-ed7ba3c1f7552106148b014cbbf4a2642dcf4adc.tar.xz |
PEP-8, Python Zen, refactor and reduce code (part 7 in master module/database)
Conflicts:
module/database/__init__.py
pyload/database/Backend.py
pyload/database/File.py
pyload/database/Storage.py
pyload/database/User.py
Diffstat (limited to 'pyload/database/Storage.py')
-rw-r--r-- | pyload/database/Storage.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pyload/database/Storage.py b/pyload/database/Storage.py index 45ad18b2d..70932b55c 100644 --- a/pyload/database/Storage.py +++ b/pyload/database/Storage.py @@ -26,14 +26,12 @@ class StorageMethods(object): return row[0] else: db.c.execute("SELECT key, value FROM storage WHERE identifier=?", (identifier,)) - d = {} - for row in db.c: - d[row[0]] = row[1] - return d + return {row[0]: row[1] for row in db.c} @style.queue def delStorage(db, identifier, key): db.c.execute("DELETE FROM storage WHERE identifier=? AND key=?", (identifier, key)) + DatabaseBackend.registerSub(StorageMethods) |