From ed7ba3c1f7552106148b014cbbf4a2642dcf4adc Mon Sep 17 00:00:00 2001 From: fedeG Date: Sun, 19 Apr 2015 17:37:58 +0200 Subject: 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 --- pyload/database/Storage.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pyload/database/Storage.py') 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) -- cgit v1.2.3