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

@ -36,13 +36,14 @@ from weakref import WeakValueDictionary
from django.conf import settings
from django.utils.translation import gettext as _
from evennia.commands.command import InterruptCommand
from evennia.utils import logger, utils
from evennia.utils.utils import string_suggestions
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.task import deferLater
from evennia.commands.command import InterruptCommand
from evennia.utils import logger, utils
from evennia.utils.utils import string_suggestions
_IN_GAME_ERRORS = settings.IN_GAME_ERRORS
__all__ = ("cmdhandler", "InterruptCommand")

View file

@ -71,6 +71,7 @@ from traceback import format_exc
from django.conf import settings
from django.utils.translation import gettext as _
from evennia.commands.cmdset import CmdSet
from evennia.server.models import ServerConfig
from evennia.utils import logger, utils

View file

@ -11,6 +11,7 @@ import re
from django.conf import settings
from django.urls import reverse
from django.utils.text import slugify
from evennia.locks.lockhandler import LockHandler
from evennia.utils.ansi import ANSIString
from evennia.utils.evtable import EvTable

View file

@ -22,6 +22,7 @@ import time
from codecs import lookup as codecs_lookup
from django.conf import settings
import evennia
from evennia.utils import create, logger, search, utils
@ -74,6 +75,7 @@ class MuxAccountLookCommand(COMMAND_DEFAULT_CLASS):
# use self.account instead of self.caller, just to be sure. Also self.msg()
# is used to make sure returns go to the right session
# note that this is inheriting from MuxAccountLookCommand,
# and has the .playable property.
class CmdOOCLook(MuxAccountLookCommand):
@ -307,7 +309,7 @@ class CmdIC(COMMAND_DEFAULT_CLASS):
else:
# argument given
if (playables := account.characters):
if playables := account.characters:
# look at the playable_characters list first
character_candidates.extend(
utils.make_iter(

View file

@ -9,9 +9,8 @@ import time
from django.conf import settings
from evennia.server.models import ServerConfig
import evennia
from evennia.server.models import ServerConfig
from evennia.utils import class_from_module, evtable, logger, search
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
@ -512,7 +511,6 @@ class CmdPerm(COMMAND_DEFAULT_CLASS):
permissions = obj.permissions.all()
for perm in self.rhslist:
# don't allow to set a permission higher in the hierarchy than
# the one the caller has (to prevent self-escalation)
if perm.lower() in PERMISSION_HIERARCHY and not obj.locks.check_lockstring(

View file

@ -6,6 +6,7 @@ import re
from django.conf import settings
from django.core.paginator import Paginator
from django.db.models import Max, Min, Q
from evennia import InterruptCommand
from evennia.commands.cmdhandler import get_and_merge_cmdsets
from evennia.locks.lockhandler import LockException

View file

@ -8,6 +8,7 @@ Communication commands:
"""
from django.conf import settings
from evennia.accounts import bots
from evennia.accounts.models import AccountDB
from evennia.comms.comms import DefaultChannel

View file

@ -173,7 +173,6 @@ class CmdNick(COMMAND_DEFAULT_CLASS):
)
if "list" in switches or self.cmdstring in ("nicks",):
if not nicklist:
string = "|wNo nicks defined.|n"
else:

View file

@ -13,13 +13,20 @@ from dataclasses import dataclass
from itertools import chain
from django.conf import settings
from evennia.help.filehelp import FILE_HELP_ENTRIES
from evennia.help.models import HelpEntry
from evennia.help.utils import help_search_with_index, parse_entry_for_subcategories
from evennia.utils import create, evmore
from evennia.utils.ansi import ANSIString
from evennia.utils.eveditor import EvEditor
from evennia.utils.utils import class_from_module, dedent, format_grid, inherits_from, pad
from evennia.utils.utils import (
class_from_module,
dedent,
format_grid,
inherits_from,
pad,
)
CMD_IGNORE_PREFIXES = settings.CMD_IGNORE_PREFIXES
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)

View file

@ -13,9 +13,10 @@ import time
import traceback
import django
import evennia
import twisted
from django.conf import settings
import evennia
from evennia.accounts.models import AccountDB
from evennia.scripts.taskhandler import TaskHandlerTask
from evennia.utils import gametime, logger, search, utils

View file

@ -17,6 +17,9 @@ from unittest.mock import MagicMock, Mock, patch
from anything import Anything
from django.conf import settings
from django.test import override_settings
from parameterized import parameterized
from twisted.internet import task
import evennia
from evennia import (
DefaultCharacter,
@ -29,7 +32,14 @@ from evennia import (
from evennia.commands import cmdparser
from evennia.commands.cmdset import CmdSet
from evennia.commands.command import Command, InterruptCommand
from evennia.commands.default import account, admin, batchprocess, building, comms, general
from evennia.commands.default import (
account,
admin,
batchprocess,
building,
comms,
general,
)
from evennia.commands.default import help as help_module
from evennia.commands.default import syscommands, system, unloggedin
from evennia.commands.default.cmdset_character import CharacterCmdSet
@ -38,8 +48,6 @@ from evennia.prototypes import prototypes as protlib
from evennia.utils import create, gametime, utils
from evennia.utils.test_resources import BaseEvenniaCommandTest # noqa
from evennia.utils.test_resources import BaseEvenniaTest, EvenniaCommandTest
from parameterized import parameterized
from twisted.internet import task
# ------------------------------------------------------------
# Command testing
@ -1597,8 +1605,9 @@ class TestBuilding(BaseEvenniaCommandTest):
self.call(
building.CmdTeleport(),
"Obj = Room2",
"Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2."
.format(oid, rid, rid2),
"Obj(#{}) is leaving Room(#{}), heading for Room2(#{}).|Teleported Obj -> Room2.".format(
oid, rid, rid2
),
)
self.call(building.CmdTeleport(), "NotFound = Room", "Could not find 'NotFound'.")
self.call(
@ -1714,8 +1723,7 @@ class TestBuilding(BaseEvenniaCommandTest):
self.call(
building.CmdSpawn(),
"{'prototype_key':'GOBLIN', 'typeclass':'evennia.objects.objects.DefaultCharacter', "
"'key':'goblin', 'location':'%s'}"
% spawnLoc.dbref,
"'key':'goblin', 'location':'%s'}" % spawnLoc.dbref,
"Spawned goblin",
)
goblin = get_object(self, "goblin")
@ -1763,8 +1771,7 @@ class TestBuilding(BaseEvenniaCommandTest):
self.call(
building.CmdSpawn(),
"/noloc {'prototype_parent':'TESTBALL', 'key': 'Ball', 'prototype_key': 'foo',"
" 'location':'%s'}"
% spawnLoc.dbref,
" 'location':'%s'}" % spawnLoc.dbref,
"Spawned Ball",
)
ball = get_object(self, "Ball")

View file

@ -6,8 +6,9 @@ import datetime
import re
from codecs import lookup as codecs_lookup
import evennia
from django.conf import settings
import evennia
from evennia.commands.cmdhandler import CMD_LOGINSTART
from evennia.comms.models import ChannelDB
from evennia.utils import class_from_module, create, gametime, logger, utils

View file

@ -4,6 +4,7 @@ Unit testing for the Command system itself.
"""
from django.test import override_settings
from evennia.commands import cmdparser
from evennia.commands.cmdset import CmdSet
from evennia.commands.command import Command
@ -990,9 +991,10 @@ class TestOptionTransferReplace(TestCase):
import sys
from evennia.commands import cmdhandler
from twisted.trial.unittest import TestCase as TwistedTestCase
from evennia.commands import cmdhandler
def _mockdelay(time, func, *args, **kwargs):
return func(*args, **kwargs)
@ -1250,7 +1252,6 @@ class TestIssue3090(BaseEvenniaTest):
"""
def test_long_aliases(self):
cmdset_g = _CmdSetG()
# print(cmdset_g.commands[0]._keyaliases)