mirror of
https://github.com/evennia/evennia.git
synced 2025-10-29 11:26:10 +00:00
Use isort, run format on code
This commit is contained in:
parent
617bff3c82
commit
eafe390db4
5
Makefile
5
Makefile
@ -1,7 +1,6 @@
|
|||||||
# This is used with `make <option>` and is used for running various
|
# This is used with `make <option>` and is used for running various
|
||||||
# administration operations on the code.
|
# administration operations on the code.
|
||||||
|
|
||||||
BLACK_FORMAT_CONFIGS = --target-version py37 --line-length 100 --exclude=/docs
|
|
||||||
TEST_GAME_DIR = .test_game_dir
|
TEST_GAME_DIR = .test_game_dir
|
||||||
TESTS ?= evennia
|
TESTS ?= evennia
|
||||||
|
|
||||||
@ -22,8 +21,10 @@ installextra:
|
|||||||
pip install -e .
|
pip install -e .
|
||||||
pip install -r requirements_extra.txt
|
pip install -r requirements_extra.txt
|
||||||
|
|
||||||
|
# black is configured from pyproject.toml
|
||||||
format:
|
format:
|
||||||
black $(BLACK_FORMAT_CONFIGS) evennia
|
black evennia
|
||||||
|
isort . --profile black
|
||||||
|
|
||||||
fmt: format
|
fmt: format
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,7 @@ To test - import this from a Django-aware shell, then call run_update.
|
|||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
from os.path import join as pathjoin
|
from os.path import join as pathjoin
|
||||||
|
|
||||||
from evennia.utils.utils import (callables_from_module, mod_import,
|
from evennia.utils.utils import callables_from_module, mod_import, variable_from_module
|
||||||
variable_from_module)
|
|
||||||
|
|
||||||
__all__ = "run_update"
|
__all__ = "run_update"
|
||||||
|
|
||||||
|
|||||||
@ -172,7 +172,12 @@ def _init():
|
|||||||
from .comms.models import ChannelDB, Msg
|
from .comms.models import ChannelDB, Msg
|
||||||
from .locks import lockfuncs
|
from .locks import lockfuncs
|
||||||
from .objects.models import ObjectDB
|
from .objects.models import ObjectDB
|
||||||
from .objects.objects import DefaultCharacter, DefaultExit, DefaultObject, DefaultRoom
|
from .objects.objects import (
|
||||||
|
DefaultCharacter,
|
||||||
|
DefaultExit,
|
||||||
|
DefaultObject,
|
||||||
|
DefaultRoom,
|
||||||
|
)
|
||||||
from .prototypes.spawner import spawn
|
from .prototypes.spawner import spawn
|
||||||
from .scripts.models import ScriptDB
|
from .scripts.models import ScriptDB
|
||||||
from .scripts.monitorhandler import MONITOR_HANDLER
|
from .scripts.monitorhandler import MONITOR_HANDLER
|
||||||
|
|||||||
@ -38,7 +38,13 @@ from evennia.typeclasses.attributes import ModelAttributeBackend, NickHandler
|
|||||||
from evennia.typeclasses.models import TypeclassBase
|
from evennia.typeclasses.models import TypeclassBase
|
||||||
from evennia.utils import class_from_module, create, logger
|
from evennia.utils import class_from_module, create, logger
|
||||||
from evennia.utils.optionhandler import OptionHandler
|
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")
|
__all__ = ("DefaultAccount", "DefaultGuest")
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,11 @@ from unittest import TestCase
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from mock import MagicMock, Mock, patch
|
from mock import MagicMock, Mock, patch
|
||||||
|
|
||||||
from evennia.accounts.accounts import AccountSessionHandler, DefaultAccount, DefaultGuest
|
from evennia.accounts.accounts import (
|
||||||
|
AccountSessionHandler,
|
||||||
|
DefaultAccount,
|
||||||
|
DefaultGuest,
|
||||||
|
)
|
||||||
from evennia.utils import create
|
from evennia.utils import create
|
||||||
from evennia.utils.test_resources import BaseEvenniaTest
|
from evennia.utils.test_resources import BaseEvenniaTest
|
||||||
from evennia.utils.utils import uses_database
|
from evennia.utils.utils import uses_database
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import re
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models import Max, Min, Q
|
from django.db.models import Max, Min, Q
|
||||||
|
|
||||||
from evennia import InterruptCommand
|
from evennia import InterruptCommand
|
||||||
from evennia.commands.cmdhandler import get_and_merge_cmdsets
|
from evennia.commands.cmdhandler import get_and_merge_cmdsets
|
||||||
from evennia.locks.lockhandler import LockException
|
from evennia.locks.lockhandler import LockException
|
||||||
|
|||||||
@ -10,7 +10,15 @@ command method rather than caller.msg().
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from evennia.commands.cmdset import CmdSet
|
from evennia.commands.cmdset import CmdSet
|
||||||
from evennia.commands.default import account, admin, building, comms, general, help, system
|
from evennia.commands.default import (
|
||||||
|
account,
|
||||||
|
admin,
|
||||||
|
building,
|
||||||
|
comms,
|
||||||
|
general,
|
||||||
|
help,
|
||||||
|
system,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AccountCmdSet(CmdSet):
|
class AccountCmdSet(CmdSet):
|
||||||
|
|||||||
@ -5,7 +5,14 @@ communication-commands are instead put on the account level, in the
|
|||||||
Account cmdset. Account commands remain available also to Characters.
|
Account cmdset. Account commands remain available also to Characters.
|
||||||
"""
|
"""
|
||||||
from evennia.commands.cmdset import CmdSet
|
from evennia.commands.cmdset import CmdSet
|
||||||
from evennia.commands.default import admin, batchprocess, building, general, help, system
|
from evennia.commands.default import (
|
||||||
|
admin,
|
||||||
|
batchprocess,
|
||||||
|
building,
|
||||||
|
general,
|
||||||
|
help,
|
||||||
|
system,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CharacterCmdSet(CmdSet):
|
class CharacterCmdSet(CmdSet):
|
||||||
|
|||||||
@ -20,7 +20,13 @@ from evennia.help.utils import help_search_with_index, parse_entry_for_subcatego
|
|||||||
from evennia.utils import create, evmore
|
from evennia.utils import create, evmore
|
||||||
from evennia.utils.ansi import ANSIString
|
from evennia.utils.ansi import ANSIString
|
||||||
from evennia.utils.eveditor import EvEditor
|
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
|
CMD_IGNORE_PREFIXES = settings.CMD_IGNORE_PREFIXES
|
||||||
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
|
||||||
|
|||||||
@ -31,7 +31,14 @@ from evennia import (
|
|||||||
from evennia.commands import cmdparser
|
from evennia.commands import cmdparser
|
||||||
from evennia.commands.cmdset import CmdSet
|
from evennia.commands.cmdset import CmdSet
|
||||||
from evennia.commands.command import Command, InterruptCommand
|
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 help as help_module
|
||||||
from evennia.commands.default import syscommands, system, unloggedin
|
from evennia.commands.default import syscommands, system, unloggedin
|
||||||
from evennia.commands.default.cmdset_character import CharacterCmdSet
|
from evennia.commands.default.cmdset_character import CharacterCmdSet
|
||||||
|
|||||||
@ -10,7 +10,10 @@ See the docs for more information.
|
|||||||
|
|
||||||
from evennia.contrib.base_systems.components.component import Component
|
from evennia.contrib.base_systems.components.component import Component
|
||||||
from evennia.contrib.base_systems.components.dbfield import DBField, NDBField, TagField
|
from evennia.contrib.base_systems.components.dbfield import DBField, NDBField, TagField
|
||||||
from evennia.contrib.base_systems.components.holder import ComponentHolderMixin, ComponentProperty
|
from evennia.contrib.base_systems.components.holder import (
|
||||||
|
ComponentHolderMixin,
|
||||||
|
ComponentProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_component_class(component_name):
|
def get_component_class(component_name):
|
||||||
|
|||||||
@ -1,5 +1,13 @@
|
|||||||
from evennia.contrib.base_systems.components import Component, DBField, TagField, signals
|
from evennia.contrib.base_systems.components import (
|
||||||
from evennia.contrib.base_systems.components.holder import ComponentHolderMixin, ComponentProperty
|
Component,
|
||||||
|
DBField,
|
||||||
|
TagField,
|
||||||
|
signals,
|
||||||
|
)
|
||||||
|
from evennia.contrib.base_systems.components.holder import (
|
||||||
|
ComponentHolderMixin,
|
||||||
|
ComponentProperty,
|
||||||
|
)
|
||||||
from evennia.contrib.base_systems.components.signals import as_listener
|
from evennia.contrib.base_systems.components.signals import as_listener
|
||||||
from evennia.objects.objects import DefaultCharacter
|
from evennia.objects.objects import DefaultCharacter
|
||||||
from evennia.utils import create
|
from evennia.utils import create
|
||||||
|
|||||||
@ -12,7 +12,11 @@ from django.conf import settings
|
|||||||
|
|
||||||
from evennia import ChannelDB, DefaultObject, DefaultScript, ScriptDB, logger
|
from evennia import ChannelDB, DefaultObject, DefaultScript, ScriptDB, logger
|
||||||
from evennia.contrib.base_systems.ingame_python.callbackhandler import CallbackHandler
|
from evennia.contrib.base_systems.ingame_python.callbackhandler import CallbackHandler
|
||||||
from evennia.contrib.base_systems.ingame_python.utils import EVENTS, InterruptEvent, get_next_wait
|
from evennia.contrib.base_systems.ingame_python.utils import (
|
||||||
|
EVENTS,
|
||||||
|
InterruptEvent,
|
||||||
|
get_next_wait,
|
||||||
|
)
|
||||||
from evennia.utils.ansi import raw
|
from evennia.utils.ansi import raw
|
||||||
from evennia.utils.create import create_channel
|
from evennia.utils.create import create_channel
|
||||||
from evennia.utils.dbserialize import dbserialize
|
from evennia.utils.dbserialize import dbserialize
|
||||||
|
|||||||
@ -9,7 +9,9 @@ from django.conf import settings
|
|||||||
|
|
||||||
from evennia import ScriptDB, logger
|
from evennia import ScriptDB, logger
|
||||||
from evennia.contrib.base_systems.custom_gametime import UNITS, gametime_to_realtime
|
from evennia.contrib.base_systems.custom_gametime import UNITS, gametime_to_realtime
|
||||||
from evennia.contrib.base_systems.custom_gametime import real_seconds_until as custom_rsu
|
from evennia.contrib.base_systems.custom_gametime import (
|
||||||
|
real_seconds_until as custom_rsu,
|
||||||
|
)
|
||||||
from evennia.utils.create import create_script
|
from evennia.utils.create import create_script
|
||||||
from evennia.utils.gametime import real_seconds_until as standard_rsu
|
from evennia.utils.gametime import real_seconds_until as standard_rsu
|
||||||
from evennia.utils.utils import class_from_module
|
from evennia.utils.utils import class_from_module
|
||||||
|
|||||||
@ -21,6 +21,7 @@ of the screen is done by the unlogged-in "look" command.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from evennia import utils
|
from evennia import utils
|
||||||
|
|
||||||
CONNECTION_SCREEN = """
|
CONNECTION_SCREEN = """
|
||||||
|
|||||||
@ -21,9 +21,14 @@ called automatically when a new user connects.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from evennia import CmdSet, Command, syscmdkeys
|
from evennia import CmdSet, Command, syscmdkeys
|
||||||
from evennia.utils.evmenu import EvMenu
|
from evennia.utils.evmenu import EvMenu
|
||||||
from evennia.utils.utils import callables_from_module, class_from_module, random_string_from_module
|
from evennia.utils.utils import (
|
||||||
|
callables_from_module,
|
||||||
|
class_from_module,
|
||||||
|
random_string_from_module,
|
||||||
|
)
|
||||||
|
|
||||||
_CONNECTION_SCREEN_MODULE = settings.CONNECTION_SCREEN_MODULE
|
_CONNECTION_SCREEN_MODULE = settings.CONNECTION_SCREEN_MODULE
|
||||||
_GUEST_ENABLED = settings.GUEST_ENABLED
|
_GUEST_ENABLED = settings.GUEST_ENABLED
|
||||||
|
|||||||
@ -31,7 +31,14 @@ import re
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from evennia import SESSION_HANDLER, CmdSet, Command, InterruptCommand, default_cmds, syscmdkeys
|
from evennia import (
|
||||||
|
SESSION_HANDLER,
|
||||||
|
CmdSet,
|
||||||
|
Command,
|
||||||
|
InterruptCommand,
|
||||||
|
default_cmds,
|
||||||
|
syscmdkeys,
|
||||||
|
)
|
||||||
from evennia.utils import variable_from_module
|
from evennia.utils import variable_from_module
|
||||||
|
|
||||||
from .utils import create_evscaperoom_object
|
from .utils import create_evscaperoom_object
|
||||||
|
|||||||
@ -126,7 +126,12 @@ from evennia.commands.cmdset import CmdSet
|
|||||||
from evennia.commands.command import Command
|
from evennia.commands.command import Command
|
||||||
from evennia.prototypes.spawner import spawn
|
from evennia.prototypes.spawner import spawn
|
||||||
from evennia.utils.create import create_object
|
from evennia.utils.create import create_object
|
||||||
from evennia.utils.utils import callables_from_module, inherits_from, iter_to_str, make_iter
|
from evennia.utils.utils import (
|
||||||
|
callables_from_module,
|
||||||
|
inherits_from,
|
||||||
|
iter_to_str,
|
||||||
|
make_iter,
|
||||||
|
)
|
||||||
|
|
||||||
_RECIPE_CLASSES = {}
|
_RECIPE_CLASSES = {}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,14 @@ are spawened on their corresponding location.
|
|||||||
import itertools
|
import itertools
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
||||||
from evennia import CmdSet, DefaultCharacter, DefaultExit, DefaultRoom, DefaultScript, create_script
|
from evennia import (
|
||||||
|
CmdSet,
|
||||||
|
DefaultCharacter,
|
||||||
|
DefaultExit,
|
||||||
|
DefaultRoom,
|
||||||
|
DefaultScript,
|
||||||
|
create_script,
|
||||||
|
)
|
||||||
from evennia.commands.default.muxcommand import MuxCommand
|
from evennia.commands.default.muxcommand import MuxCommand
|
||||||
from evennia.prototypes.spawner import spawn
|
from evennia.prototypes.spawner import spawn
|
||||||
from evennia.utils import logger, search, utils
|
from evennia.utils import logger, search, utils
|
||||||
|
|||||||
@ -113,7 +113,13 @@ create a new wilderness (with the name "default") but using our new map provider
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from evennia import DefaultExit, DefaultRoom, DefaultScript, create_object, create_script
|
from evennia import (
|
||||||
|
DefaultExit,
|
||||||
|
DefaultRoom,
|
||||||
|
DefaultScript,
|
||||||
|
create_object,
|
||||||
|
create_script,
|
||||||
|
)
|
||||||
from evennia.utils import inherits_from
|
from evennia.utils import inherits_from
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -460,7 +460,12 @@ from django.conf import settings
|
|||||||
|
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.dbserialize import _SaverDict
|
from evennia.utils.dbserialize import _SaverDict
|
||||||
from evennia.utils.utils import class_from_module, inherits_from, list_to_string, percent
|
from evennia.utils.utils import (
|
||||||
|
class_from_module,
|
||||||
|
inherits_from,
|
||||||
|
list_to_string,
|
||||||
|
percent,
|
||||||
|
)
|
||||||
|
|
||||||
# Available Trait classes.
|
# Available Trait classes.
|
||||||
# This way the user can easily supply their own. Each
|
# This way the user can easily supply their own. Each
|
||||||
|
|||||||
@ -26,7 +26,10 @@ from evennia.contrib.tutorials.evadventure.dungeon import (
|
|||||||
EvAdventureDungeonStartRoomExit,
|
EvAdventureDungeonStartRoomExit,
|
||||||
)
|
)
|
||||||
from evennia.contrib.tutorials.evadventure.objects import EvAdventureWeapon
|
from evennia.contrib.tutorials.evadventure.objects import EvAdventureWeapon
|
||||||
from evennia.contrib.tutorials.evadventure.rooms import EvAdventurePvPRoom, EvAdventureRoom
|
from evennia.contrib.tutorials.evadventure.rooms import (
|
||||||
|
EvAdventurePvPRoom,
|
||||||
|
EvAdventureRoom,
|
||||||
|
)
|
||||||
|
|
||||||
# CODE
|
# CODE
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,12 @@ from django.utils.text import slugify
|
|||||||
|
|
||||||
from evennia.locks.lockhandler import LockHandler
|
from evennia.locks.lockhandler import LockHandler
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.utils import all_from_module, lazy_property, make_iter, variable_from_module
|
from evennia.utils.utils import (
|
||||||
|
all_from_module,
|
||||||
|
lazy_property,
|
||||||
|
make_iter,
|
||||||
|
variable_from_module,
|
||||||
|
)
|
||||||
|
|
||||||
_DEFAULT_HELP_CATEGORY = settings.DEFAULT_HELP_CATEGORY
|
_DEFAULT_HELP_CATEGORY = settings.DEFAULT_HELP_CATEGORY
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,11 @@ the grapevine client to in-game channels.
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
|
from autobahn.twisted.websocket import (
|
||||||
|
WebSocketClientFactory,
|
||||||
|
WebSocketClientProtocol,
|
||||||
|
connectWS,
|
||||||
|
)
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from twisted.internet import protocol
|
from twisted.internet import protocol
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,12 @@ evennia._init()
|
|||||||
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||||
from evennia.server.webserver import EvenniaReverseProxyResource
|
from evennia.server.webserver import EvenniaReverseProxyResource
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.utils import class_from_module, get_evennia_version, make_iter, mod_import
|
from evennia.utils.utils import (
|
||||||
|
class_from_module,
|
||||||
|
get_evennia_version,
|
||||||
|
make_iter,
|
||||||
|
mod_import,
|
||||||
|
)
|
||||||
|
|
||||||
# we don't need a connection to the database so close it right away
|
# we don't need a connection to the database so close it right away
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -24,7 +24,12 @@ from twisted.trial.unittest import TestCase as TwistedTestCase
|
|||||||
from evennia.server.portal import irc
|
from evennia.server.portal import irc
|
||||||
from evennia.utils.test_resources import BaseEvenniaTest
|
from evennia.utils.test_resources import BaseEvenniaTest
|
||||||
|
|
||||||
from .amp import AMP_MAXLEN, AMPMultiConnectionProtocol, MsgPortal2Server, MsgServer2Portal
|
from .amp import (
|
||||||
|
AMP_MAXLEN,
|
||||||
|
AMPMultiConnectionProtocol,
|
||||||
|
MsgPortal2Server,
|
||||||
|
MsgServer2Portal,
|
||||||
|
)
|
||||||
from .amp_server import AMPServerFactory
|
from .amp_server import AMPServerFactory
|
||||||
from .mccp import MCCP
|
from .mccp import MCCP
|
||||||
from .mssp import MSSP
|
from .mssp import MSSP
|
||||||
|
|||||||
@ -14,7 +14,11 @@ from django.utils import timezone
|
|||||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||||
from evennia.comms.models import ChannelDB
|
from evennia.comms.models import ChannelDB
|
||||||
from evennia.scripts.monitorhandler import MONITOR_HANDLER
|
from evennia.scripts.monitorhandler import MONITOR_HANDLER
|
||||||
from evennia.typeclasses.attributes import AttributeHandler, DbHolder, InMemoryAttributeBackend
|
from evennia.typeclasses.attributes import (
|
||||||
|
AttributeHandler,
|
||||||
|
DbHolder,
|
||||||
|
InMemoryAttributeBackend,
|
||||||
|
)
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.utils import class_from_module, lazy_property, make_iter
|
from evennia.utils.utils import class_from_module, lazy_property, make_iter
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,13 @@ from evennia.server.signals import (
|
|||||||
SIGNAL_ACCOUNT_POST_LOGOUT,
|
SIGNAL_ACCOUNT_POST_LOGOUT,
|
||||||
)
|
)
|
||||||
from evennia.utils.logger import log_trace
|
from evennia.utils.logger import log_trace
|
||||||
from evennia.utils.utils import callables_from_module, class_from_module, delay, is_iter, make_iter
|
from evennia.utils.utils import (
|
||||||
|
callables_from_module,
|
||||||
|
class_from_module,
|
||||||
|
delay,
|
||||||
|
is_iter,
|
||||||
|
make_iter,
|
||||||
|
)
|
||||||
|
|
||||||
_FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED = settings.FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED
|
_FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED = settings.FUNCPARSER_PARSE_OUTGOING_MESSAGES_ENABLED
|
||||||
_BROADCAST_SERVER_RESTART_MESSAGES = settings.BROADCAST_SERVER_RESTART_MESSAGES
|
_BROADCAST_SERVER_RESTART_MESSAGES = settings.BROADCAST_SERVER_RESTART_MESSAGES
|
||||||
|
|||||||
@ -91,9 +91,9 @@ SIGNAL_CHANNEL_POST_CREATE = Signal()
|
|||||||
|
|
||||||
from django.core.signals import request_finished # " ends.
|
from django.core.signals import request_finished # " ends.
|
||||||
from django.core.signals import request_started # Sent when HTTP request begins.
|
from django.core.signals import request_started # Sent when HTTP request begins.
|
||||||
from django.db.backends.signals import (
|
from django.db.backends.signals import ( # Sent when making initial connection to database
|
||||||
connection_created,
|
connection_created,
|
||||||
) # Sent when making initial connection to database
|
)
|
||||||
from django.db.models.signals import m2m_changed # Sent when a ManyToManyField changes.
|
from django.db.models.signals import m2m_changed # Sent when a ManyToManyField changes.
|
||||||
from django.db.models.signals import post_delete # after "
|
from django.db.models.signals import post_delete # after "
|
||||||
from django.db.models.signals import post_init # end
|
from django.db.models.signals import post_init # end
|
||||||
@ -101,9 +101,15 @@ from django.db.models.signals import post_migrate # after "
|
|||||||
from django.db.models.signals import post_save # after "
|
from django.db.models.signals import post_save # after "
|
||||||
from django.db.models.signals import pre_delete # Sent before an object is deleted.
|
from django.db.models.signals import pre_delete # Sent before an object is deleted.
|
||||||
from django.db.models.signals import pre_migrate # Sent before migration starts
|
from django.db.models.signals import pre_migrate # Sent before migration starts
|
||||||
from django.db.models.signals import pre_save # Sent before a typeclass' .save is called.
|
|
||||||
from django.db.models.signals import (
|
from django.db.models.signals import (
|
||||||
|
pre_save, # Sent before a typeclass' .save is called.
|
||||||
|
)
|
||||||
|
from django.db.models.signals import ( # Sent at start of typeclass __init__ (before at_init)
|
||||||
pre_init,
|
pre_init,
|
||||||
) # Sent at start of typeclass __init__ (before at_init)
|
)
|
||||||
from django.test.signals import setting_changed # Sent when setting changes from override
|
from django.test.signals import (
|
||||||
from django.test.signals import template_rendered # Sent when test system renders template
|
setting_changed, # Sent when setting changes from override
|
||||||
|
)
|
||||||
|
from django.test.signals import (
|
||||||
|
template_rendered, # Sent when test system renders template
|
||||||
|
)
|
||||||
|
|||||||
@ -46,7 +46,13 @@ from evennia.typeclasses.attributes import (
|
|||||||
InMemoryAttributeBackend,
|
InMemoryAttributeBackend,
|
||||||
ModelAttributeBackend,
|
ModelAttributeBackend,
|
||||||
)
|
)
|
||||||
from evennia.typeclasses.tags import AliasHandler, PermissionHandler, Tag, TagHandler, TagProperty
|
from evennia.typeclasses.tags import (
|
||||||
|
AliasHandler,
|
||||||
|
PermissionHandler,
|
||||||
|
Tag,
|
||||||
|
TagHandler,
|
||||||
|
TagProperty,
|
||||||
|
)
|
||||||
from evennia.utils.idmapper.models import SharedMemoryModel, SharedMemoryModelBase
|
from evennia.utils.idmapper.models import SharedMemoryModel, SharedMemoryModelBase
|
||||||
from evennia.utils.logger import log_trace
|
from evennia.utils.logger import log_trace
|
||||||
from evennia.utils.utils import class_from_module, inherits_from, is_iter, lazy_property
|
from evennia.utils.utils import class_from_module, inherits_from, is_iter, lazy_property
|
||||||
|
|||||||
@ -15,6 +15,7 @@ from pickle import dumps
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.utils import OperationalError, ProgrammingError
|
from django.db.utils import OperationalError, ProgrammingError
|
||||||
|
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.utils import callables_from_module, class_from_module
|
from evennia.utils.utils import callables_from_module, class_from_module
|
||||||
|
|
||||||
|
|||||||
@ -273,12 +273,22 @@ from django.conf import settings
|
|||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from evennia import CmdSet, Command
|
from evennia import CmdSet, Command
|
||||||
from evennia.commands import cmdhandler
|
from evennia.commands import cmdhandler
|
||||||
from evennia.utils import logger
|
from evennia.utils import logger
|
||||||
from evennia.utils.ansi import strip_ansi
|
from evennia.utils.ansi import strip_ansi
|
||||||
from evennia.utils.evtable import EvColumn, EvTable
|
from evennia.utils.evtable import EvColumn, EvTable
|
||||||
from evennia.utils.utils import crop, dedent, is_iter, m_len, make_iter, mod_import, pad, to_str
|
from evennia.utils.utils import (
|
||||||
|
crop,
|
||||||
|
dedent,
|
||||||
|
is_iter,
|
||||||
|
m_len,
|
||||||
|
make_iter,
|
||||||
|
mod_import,
|
||||||
|
pad,
|
||||||
|
to_str,
|
||||||
|
)
|
||||||
|
|
||||||
# read from protocol NAWS later?
|
# read from protocol NAWS later?
|
||||||
_MAX_TEXT_WIDTH = settings.CLIENT_DEFAULT_WIDTH
|
_MAX_TEXT_WIDTH = settings.CLIENT_DEFAULT_WIDTH
|
||||||
|
|||||||
@ -434,7 +434,9 @@ class SharedMemoryModel(Model, metaclass=SharedMemoryModelBase):
|
|||||||
"""
|
"""
|
||||||
global _MONITOR_HANDLER
|
global _MONITOR_HANDLER
|
||||||
if not _MONITOR_HANDLER:
|
if not _MONITOR_HANDLER:
|
||||||
from evennia.scripts.monitorhandler import MONITOR_HANDLER as _MONITOR_HANDLER
|
from evennia.scripts.monitorhandler import (
|
||||||
|
MONITOR_HANDLER as _MONITOR_HANDLER,
|
||||||
|
)
|
||||||
|
|
||||||
if _IS_SUBPROCESS:
|
if _IS_SUBPROCESS:
|
||||||
# we keep a store of objects modified in subprocesses so
|
# we keep a store of objects modified in subprocesses so
|
||||||
|
|||||||
@ -35,7 +35,12 @@ from evennia import settings_default
|
|||||||
from evennia.accounts.accounts import DefaultAccount
|
from evennia.accounts.accounts import DefaultAccount
|
||||||
from evennia.commands.command import InterruptCommand
|
from evennia.commands.command import InterruptCommand
|
||||||
from evennia.commands.default.muxcommand import MuxCommand
|
from evennia.commands.default.muxcommand import MuxCommand
|
||||||
from evennia.objects.objects import DefaultCharacter, DefaultExit, DefaultObject, DefaultRoom
|
from evennia.objects.objects import (
|
||||||
|
DefaultCharacter,
|
||||||
|
DefaultExit,
|
||||||
|
DefaultObject,
|
||||||
|
DefaultRoom,
|
||||||
|
)
|
||||||
from evennia.scripts.scripts import DefaultScript
|
from evennia.scripts.scripts import DefaultScript
|
||||||
from evennia.server.serversession import ServerSession
|
from evennia.server.serversession import ServerSession
|
||||||
from evennia.server.sessionhandler import SESSIONS
|
from evennia.server.sessionhandler import SESSIONS
|
||||||
|
|||||||
@ -17,7 +17,12 @@ from evennia.utils import class_from_module
|
|||||||
from evennia.web.website import forms
|
from evennia.web.website import forms
|
||||||
|
|
||||||
from .mixins import TypeclassMixin
|
from .mixins import TypeclassMixin
|
||||||
from .objects import ObjectCreateView, ObjectDeleteView, ObjectDetailView, ObjectUpdateView
|
from .objects import (
|
||||||
|
ObjectCreateView,
|
||||||
|
ObjectDeleteView,
|
||||||
|
ObjectDetailView,
|
||||||
|
ObjectUpdateView,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CharacterMixin(TypeclassMixin):
|
class CharacterMixin(TypeclassMixin):
|
||||||
|
|||||||
@ -14,7 +14,12 @@ from django.utils.text import slugify
|
|||||||
|
|
||||||
from evennia.utils import class_from_module
|
from evennia.utils import class_from_module
|
||||||
|
|
||||||
from .mixins import EvenniaCreateView, EvenniaDeleteView, EvenniaDetailView, EvenniaUpdateView
|
from .mixins import (
|
||||||
|
EvenniaCreateView,
|
||||||
|
EvenniaDeleteView,
|
||||||
|
EvenniaDetailView,
|
||||||
|
EvenniaUpdateView,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ObjectDetailView(EvenniaDetailView):
|
class ObjectDetailView(EvenniaDetailView):
|
||||||
|
|||||||
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
|
|||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
target-version = ['py37', 'py38']
|
target-version = ['py39', 'py310', 'py311']
|
||||||
exclude = '''
|
exclude = '''
|
||||||
|
|
||||||
(
|
(
|
||||||
@ -21,6 +21,7 @@ exclude = '''
|
|||||||
| dist
|
| dist
|
||||||
)/
|
)/
|
||||||
| migrations
|
| migrations
|
||||||
|
| docs
|
||||||
|
|
||||||
)
|
)
|
||||||
'''
|
'''
|
||||||
|
|||||||
@ -25,7 +25,8 @@ attrs >= 19.2.0
|
|||||||
model_mommy
|
model_mommy
|
||||||
mock >= 1.0.1
|
mock >= 1.0.1
|
||||||
anything==0.2.1
|
anything==0.2.1
|
||||||
black
|
black >= 22.6
|
||||||
|
isort >= 5.10
|
||||||
wheel
|
wheel
|
||||||
parameterized==0.8.1
|
parameterized==0.8.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user