diff options
| author | 2025-07-31 01:22:01 -0400 | |
|---|---|---|
| committer | 2025-07-31 01:22:01 -0400 | |
| commit | a6e995c093de8aae2e91a0787281bb34c0b871eb (patch) | |
| tree | 2d79821b05300d34d8871eb6c9662b359a2de85d /gallery_dl/cache.py | |
| parent | 7672a750cb74bf31e21d76aad2776367fd476155 (diff) | |
New upstream version 1.30.2.upstream/1.30.2
Diffstat (limited to 'gallery_dl/cache.py')
| -rw-r--r-- | gallery_dl/cache.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gallery_dl/cache.py b/gallery_dl/cache.py index 923ed32..b04552e 100644 --- a/gallery_dl/cache.py +++ b/gallery_dl/cache.py @@ -73,7 +73,7 @@ class DatabaseCacheDecorator(): _init = True def __init__(self, func, keyarg, maxage): - self.key = "%s.%s" % (func.__module__, func.__name__) + self.key = f"{func.__module__}.{func.__name__}" self.func = func self.cache = {} self.keyarg = keyarg @@ -95,7 +95,7 @@ class DatabaseCacheDecorator(): pass # database lookup - fullkey = "%s-%s" % (self.key, key) + fullkey = f"{self.key}-{key}" with self.database() as db: cursor = db.cursor() try: @@ -128,7 +128,7 @@ class DatabaseCacheDecorator(): with self.database() as db: db.execute( "INSERT OR REPLACE INTO data VALUES (?,?,?)", - ("%s-%s" % (self.key, key), pickle.dumps(value), expires), + (f"{self.key}-{key}", pickle.dumps(value), expires), ) def invalidate(self, key): @@ -139,7 +139,7 @@ class DatabaseCacheDecorator(): with self.database() as db: db.execute( "DELETE FROM data WHERE key=?", - ("%s-%s" % (self.key, key),), + (f"{self.key}-{key}",), ) def database(self): |
