From 1159e81caceadbf4e6e8b0bc366a2d2071e7b932 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 18 Oct 2020 19:27:56 +0000 Subject: [PATCH] Change methods not using its bound instance to staticmethods --- personalBestCache.py | 6 ++++-- tomejerry.py | 3 ++- userStatsCache.py | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/personalBestCache.py b/personalBestCache.py index 3a382598..b06fbf89 100644 --- a/personalBestCache.py +++ b/personalBestCache.py @@ -6,7 +6,8 @@ class cacheMiss(Exception): pass class personalBestCache: - def get(self, userID, fileMd5, country=False, friends=False, mods=-1): + @staticmethod + def get(userID, fileMd5, country=False, friends=False, mods=-1): """ Get cached personal best rank @@ -42,7 +43,8 @@ def get(self, userID, fileMd5, country=False, friends=False, mods=-1): log.debug("personalBestCache miss") return 0 - def set(self, userID, rank, fileMd5, country=False, friends=False, mods=-1): + @staticmethod + def set(userID, rank, fileMd5, country=False, friends=False, mods=-1): """ Set userID's redis personal best cache diff --git a/tomejerry.py b/tomejerry.py index 666d9fe8..21cc317b 100644 --- a/tomejerry.py +++ b/tomejerry.py @@ -219,7 +219,8 @@ def recycle(self, start: bool=True): if start: self.threaded_work() - def recalc_score(self, score_data: Dict) -> score: + @staticmethod + def recalc_score(score_data: Dict) -> score: """ Recalculates pp for a score diff --git a/userStatsCache.py b/userStatsCache.py index c26b75df..35ce6523 100644 --- a/userStatsCache.py +++ b/userStatsCache.py @@ -24,7 +24,8 @@ def get(self, userID, gameMode): retData = json.loads(data.decode("utf-8")) return retData - def update(self, userID, gameMode, data = None): + @staticmethod + def update(userID, gameMode, data = None): """ Update cached user stats in redis with new values