Fix broken command system by importing CommandContainer modules

ChatControlBase was split from ChatControl into its own module in commit
80221afc2c. With this split the import of the CommandContainer modules
was removed as well, likely because their members are not referenced
anywhere. However, importing these modules even when they are not used
directly is crucial because the contained CommandContainers are only
registered with the command system when their definitions are evaluated.

Import the modules with CommandContainers in chat_control_base.py to fix
the command system. Also add a comment stating more clearly why the
imports need to be kept around.
This commit is contained in:
Markus Böhme 2017-03-07 16:18:57 +01:00
parent 432ec7ff7d
commit f1ee561b9b
1 changed files with 7 additions and 0 deletions

View File

@ -54,6 +54,13 @@ from common.connection_handlers_events import MessageOutgoingEvent
from command_system.implementation.middleware import ChatCommandProcessor
from command_system.implementation.middleware import CommandTools
# The members of these modules are not referenced directly anywhere in this
# module, but still they need to be kept around. Importing them automatically
# registers the contained CommandContainers with the command system, thereby
# populating the list of available commands.
import command_system.implementation.standard
import command_system.implementation.execute
try:
import gtkspell
HAS_GTK_SPELL = True