Make more commands honor settings.COMMAND_DEFAULT_CLASS

As suggested in mygame\commands\command.py, I'm overriding COMMAND_DEFAULT_CLASS in settings.py to try to make sweeping changes. Having certain commands inherit directly from the base Command class thwarts this.

The only difference between Command and MuxCommand is that MuxCommand defines some custom parsing, but that's overridden by these commands anyway, so there should be no practical difference.

The import change in game_template/commands/command.py was required to fix an exception on server reload caused by the channelhandler.py change (I guess something to do with import order?)
This commit is contained in:
Tim Chaplin 2020-12-27 11:45:25 -05:00
parent f39dcb8786
commit 9923a0763d
4 changed files with 9 additions and 8 deletions

View file

@ -24,7 +24,7 @@ does this for you.
"""
from django.conf import settings
from evennia.commands import cmdset, command
from evennia.commands import cmdset
from evennia.utils.logger import tail_log_file
from evennia.utils.utils import class_from_module
from django.utils.translation import gettext as _
@ -35,9 +35,9 @@ from django.utils.translation import gettext as _
_CHANNEL_HANDLER_CLASS = None
_CHANNEL_COMMAND_CLASS = None
_CHANNELDB = None
_COMMAND_DEFAULT_CLASS = class_from_module(settings.COMMAND_DEFAULT_CLASS)
class ChannelCommand(command.Command):
class ChannelCommand(_COMMAND_DEFAULT_CLASS):
"""
{channelkey} channel