[misc] Reformat to fit new black guidelines

This commit is contained in:
Cathy Hu 2020-09-05 01:39:24 +02:00
parent 3dca6d07ba
commit 32dd8b9207
10 changed files with 43 additions and 33 deletions

View file

@ -47,7 +47,10 @@ if argv[0].endswith('kibicara'):
help='path to config file',
)
parser.add_argument(
'-v', '--verbose', action="count", help="Raise verbosity level",
'-v',
'--verbose',
action="count",
help="Raise verbosity level",
)
args = parser.parse_args()

View file

@ -183,8 +183,7 @@ class Spawner:
@classmethod
async def init_all(cls):
""" Instantiate and start a bot for every row in the corresponding ORM model.
"""
"""Instantiate and start a bot for every row in the corresponding ORM model."""
for spawner in cls.__instances:
await spawner._init()

View file

@ -41,7 +41,9 @@ class EmailBot(Censor):
try:
logger.debug('Trying to send: \n%s' % body)
email.send_email(
subscriber.email, "Kibicara " + self.hood.name, body=body,
subscriber.email,
"Kibicara " + self.hood.name,
body=body,
)
except (ConnectionRefusedError, SMTPException):
logger.exception("Sending email to subscriber failed.")

View file

@ -104,7 +104,9 @@ async def admin_register(values: BodyAdmin):
body = f'{config["frontend_url"]}/confirm?token={register_token}'
logger.debug(body)
email.send_email(
to=values.email, subject='Confirm Account', body=body,
to=values.email,
subject='Confirm Account',
body=body,
)
except (ConnectionRefusedError, SMTPException):
logger.exception('Email sending failed')
@ -113,7 +115,9 @@ async def admin_register(values: BodyAdmin):
@router.post(
'/confirm/{register_token}', response_model=BodyAccessToken, operation_id='confirm',
'/confirm/{register_token}',
response_model=BodyAccessToken,
operation_id='confirm',
)
async def admin_confirm(register_token: str):
"""Registration confirmation and account creation.
@ -130,7 +134,9 @@ async def admin_confirm(register_token: str):
@router.post(
'/login/', response_model=BodyAccessToken, operation_id='login',
'/login/',
response_model=BodyAccessToken,
operation_id='login',
)
async def admin_login(form_data: OAuth2PasswordRequestForm = Depends()):
"""Get an access token.