style(deepsource): fix some analysis fails

This commit is contained in:
Romain J 2021-01-21 16:11:29 +01:00
parent 5d585bf218
commit 01e0e5e27e
5 changed files with 13 additions and 15 deletions

View file

@ -23,6 +23,7 @@ install_requires =
humanize>=2.6.0
jishaku>=1.19.1.200
psutil>=5.7.2
requests>=2.25.1
rich>=6.0.0
structured_config>=4.12
tortoise-orm>=0.16.17

View file

@ -2,7 +2,7 @@ from discord.ext import commands
from jishaku.models import copy_context_with
_ = lambda x: x
def _(x): return x
class AliasConvertor(commands.Converter):

View file

@ -6,7 +6,8 @@ from tuxbot.cogs.Polls.functions.exceptions import (
)
from tuxbot.cogs.Polls.models import Poll
_ = lambda x: x
def _(x): return x
class PollConverter(commands.Converter):
@ -50,7 +51,7 @@ class PollConverter(commands.Converter):
class NewPropositionConvertor(commands.Converter):
async def convert(self, ctx, argument):
async def convert(self, ctx, argument): # skipcq: PYL-W0613
if len(argument) > 30:
raise TooLongProposition(
_("Your proposal must be smaller than 30")

View file

@ -166,11 +166,11 @@ class Polls(commands.Cog, name="Polls"):
for i, field in enumerate(content.get("fields")):
responders = responses.get(i, 0)
chart_options.get("data").get("labels").append(
field.get("name")[6:].replace("__", "")
chart_options["data"]["labels"].append(
field["name"][6:].replace("__", "")
)
chart_options.get("data").get("datasets")[0].get("data").append(
chart_options["data"]["datasets"][0].get("data").append(
responders
)

View file

@ -8,7 +8,7 @@ import sys
from argparse import Namespace
from pathlib import Path
from typing import Union, List
from urllib.request import urlopen
import requests
from rich.prompt import Prompt, IntPrompt
from rich.console import Console
@ -402,22 +402,18 @@ def basic_setup() -> None:
def update() -> None:
response = (
urlopen(
requests.get(
"https://api.github.com/repos/Rom1-J/tuxbot-bot/commits/master"
)
.read()
.decode("utf-8")
).json()
)
json_response = json.loads(response)
if json_response.get("sha")[:6] == version_info.build:
if response.get("sha")[:6] == version_info.build:
print(
"Nothing to update, you can run `tuxbot [instance_name]` "
"to start the bot"
)
else:
print(f"Updating to {json_response.get('sha')[:6]}...")
print(f"Updating to {response.get('sha')[:6]}...")
os.popen("/usr/bin/git pull")