Ran black on sources

This commit is contained in:
Griatch 2023-11-02 20:56:31 +01:00
parent 24d52f229f
commit f6b43b0416
125 changed files with 355 additions and 329 deletions

View file

@ -14,13 +14,14 @@ import re
import time
from random import getrandbits
import evennia
from django.conf import settings
from django.contrib.auth import authenticate, password_validation
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import timezone
from django.utils.module_loading import import_string
from django.utils.translation import gettext as _
import evennia
from evennia.accounts.manager import AccountManager
from evennia.accounts.models import AccountDB
from evennia.commands.cmdsethandler import CmdSetHandler
@ -38,7 +39,13 @@ from evennia.typeclasses.attributes import ModelAttributeBackend, NickHandler
from evennia.typeclasses.models import TypeclassBase
from evennia.utils import class_from_module, create, logger
from evennia.utils.optionhandler import OptionHandler
from evennia.utils.utils import is_iter, lazy_property, make_iter, to_str, variable_from_module
from evennia.utils.utils import (
is_iter,
lazy_property,
make_iter,
to_str,
variable_from_module,
)
__all__ = ("DefaultAccount", "DefaultGuest")
@ -1565,9 +1572,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
else:
# In this mode we don't auto-connect but by default end up at a character selection
# screen. We execute look on the account.
self.msg(
self.at_look(target=self.characters, session=session), session=session
)
self.msg(self.at_look(target=self.characters, session=session), session=session)
def at_failed_login(self, session, **kwargs):
"""

View file

@ -410,7 +410,9 @@ class RSSBot(Bot):
# instruct the server and portal to create a new session with
# the stored configuration
configdict = {"uid": self.dbid, "url": self.db.rss_url, "rate": self.db.rss_rate}
evennia.SESSION_HANDLER.start_bot_session("evennia.server.portal.rss.RSSBotFactory", configdict)
evennia.SESSION_HANDLER.start_bot_session(
"evennia.server.portal.rss.RSSBotFactory", configdict
)
def execute_cmd(self, txt=None, session=None, **kwargs):
"""
@ -658,7 +660,7 @@ class DiscordBot(Bot):
guild_id (int) - The guild the role will be assigned in.
user_id (int) - The user the given role will be assigned to.
"""
super().msg(role=(role_id, guild_id, user_id))
def direct_msg(self, message, sender, **kwargs):

View file

@ -357,9 +357,7 @@ class TestAccountPuppetDeletion(BaseEvenniaTest):
@override_settings(MULTISESSION_MODE=2)
def test_puppet_deletion(self):
# Check for existing chars
self.assertFalse(
self.account.characters, "Account should not have any chars by default."
)
self.assertFalse(self.account.characters, "Account should not have any chars by default.")
# Add char1 to account's playable characters
self.account.characters.add(self.char1)
@ -410,9 +408,7 @@ class TestDefaultAccountEv(BaseEvenniaTest):
self.assertEqual(idle, 10)
# test no sessions
with patch(
"evennia.SESSION_HANDLER.sessions_from_account", return_value=[]
) as mock_sessh:
with patch("evennia.SESSION_HANDLER.sessions_from_account", return_value=[]) as mock_sessh:
idle = self.account.idle_time
self.assertEqual(idle, None)
@ -423,9 +419,7 @@ class TestDefaultAccountEv(BaseEvenniaTest):
self.assertEqual(conn, 10)
# test no sessions
with patch(
"evennia.SESSION_HANDLER.sessions_from_account", return_value=[]
) as mock_sessh:
with patch("evennia.SESSION_HANDLER.sessions_from_account", return_value=[]) as mock_sessh:
idle = self.account.connection_time
self.assertEqual(idle, None)