aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/halloween/hacktoberstats.py
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-04 17:47:54 -0800
committerGravatar MarkKoz <[email protected]>2020-03-04 18:58:51 -0800
commitbbe81ebe0c27ea65fec1170648976d4fcd8c3f3c (patch)
treefb58f0e2c1b5b472f5de3417875613596394c26c /bot/seasons/halloween/hacktoberstats.py
parentMerge pull request #361 from ks129/games-command (diff)
Update dependencies
The pipfile will need to be re-locked to add a dependency so may as well re-pin some dependencies to reflect the more recent versions that will be used. discord.py was pinned to a patch version instead of a minor version to be on the safe side. Notable updates: * discord.py -> 1.3.2 * flake8-annotation -> 2.0 * pre-commit -> 2.1
Diffstat (limited to 'bot/seasons/halloween/hacktoberstats.py')
-rw-r--r--bot/seasons/halloween/hacktoberstats.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py
index b7b4122d..fbadb7cc 100644
--- a/bot/seasons/halloween/hacktoberstats.py
+++ b/bot/seasons/halloween/hacktoberstats.py
@@ -121,8 +121,8 @@ class HacktoberStats(commands.Cog):
"""
if self.link_json.exists():
logging.info(f"Loading linked GitHub accounts from '{self.link_json}'")
- with open(self.link_json, 'r') as fID:
- linked_accounts = json.load(fID)
+ with open(self.link_json, 'r') as file:
+ linked_accounts = json.load(file)
logging.info(f"Loaded {len(linked_accounts)} linked GitHub accounts from '{self.link_json}'")
return linked_accounts
@@ -143,8 +143,8 @@ class HacktoberStats(commands.Cog):
}
"""
logging.info(f"Saving linked_accounts to '{self.link_json}'")
- with open(self.link_json, 'w') as fID:
- json.dump(self.linked_accounts, fID, default=str)
+ with open(self.link_json, 'w') as file:
+ json.dump(self.linked_accounts, file, default=str)
logging.info(f"linked_accounts saved to '{self.link_json}'")
async def get_stats(self, ctx: commands.Context, github_username: str) -> None:
@@ -309,11 +309,11 @@ class HacktoberStats(commands.Cog):
n contribution(s) to [shortname](url)
...
"""
- baseURL = "https://www.github.com/"
+ base_url = "https://www.github.com/"
contributionstrs = []
for repo in stats['top5']:
n = repo[1]
- contributionstrs.append(f"{n} {HacktoberStats._contributionator(n)} to [{repo[0]}]({baseURL}{repo[0]})")
+ contributionstrs.append(f"{n} {HacktoberStats._contributionator(n)} to [{repo[0]}]({base_url}{repo[0]})")
return "\n".join(contributionstrs)