Philipp Hörist pushed to branch master at gajim / gajim
Commits: 432ec7ff by Markus Böhme at 2017-03-07T16:46:05+01:00 Fix usage of logger constants in command system The definition of various constants was refactored to use enumerations in commit 2fbadc91e9dc. One reference in the command system was not changed to use the new enum, however. - - - - - f1ee561b by Markus Böhme at 2017-03-07T16:46:12+01:00 Fix broken command system by importing CommandContainer modules ChatControlBase was split from ChatControl into its own module in commit 80221afc2ccb. 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. - - - - - ceb7772b by Markus Böhme at 2017-03-07T16:46:12+01:00 Correct some typos in command system comments - - - - - 01893054 by Markus Böhme at 2017-03-07T16:48:32+01:00 Fix grep command in chat window Commit d75ebd95e5e3 modified the return value of logger.py's method get_search_results_for_query by appending another component to the tuple. Because of this unpacking the tuple in the command system's grep command failed. - - - - - 205f5f30 by Philipp Hörist at 2017-03-07T17:19:11+01:00 Merge branch 'command-system-regressions' into 'master' Fix various regressions in the command system See merge request !63 - - - - - 4 changed files: - src/chat_control_base.py - src/command_system/framework.py - src/command_system/implementation/middleware.py - src/command_system/implementation/standard.py Changes: ===================================== src/chat_control_base.py ===================================== --- a/src/chat_control_base.py +++ b/src/chat_control_base.py @@ -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 ===================================== src/command_system/framework.py ===================================== --- a/src/command_system/framework.py +++ b/src/command_system/framework.py @@ -15,7 +15,7 @@ """ Provides a tiny framework with simple, yet powerful and extensible -architecture to implement commands in a streight and flexible, +architecture to implement commands in a straight and flexible, declarative way. """ @@ -67,7 +67,7 @@ class CommandProcessor(object): """ # This defines a command prefix (or an initializer), which should - # preceede a a text in order it to be processed as a command. + # precede a text in order for it to be processed as a command. COMMAND_PREFIX = '/' def process_as_command(self, text): ===================================== src/command_system/implementation/middleware.py ===================================== --- a/src/command_system/implementation/middleware.py +++ b/src/command_system/implementation/middleware.py @@ -75,7 +75,7 @@ class ChatCommandProcessor(CommandProcessor): self.command_succeeded = True def looks_like_command(self, text, body, name, arguments): - # Command escape stuff ggoes here. If text was prepended by the + # Command escape stuff goes here. If text was prepended by the # command prefix twice, like //not_a_command (if prefix is set # to /) then it will be escaped, that is sent just as a regular # message with one (only one) prefix removed, so message will be ===================================== src/command_system/implementation/standard.py ===================================== --- a/src/command_system/implementation/standard.py +++ b/src/command_system/implementation/standard.py @@ -24,7 +24,7 @@ import dialogs from common import gajim from common import helpers from common.exceptions import GajimGeneralException -from common.logger import Constants +from common.logger import KindConstant from ..errors import CommandError from ..framework import CommandContainer, command, doc @@ -32,10 +32,6 @@ from ..mapping import generate_usage from .hosts import ChatCommands, PrivateChatCommands, GroupChatCommands -# This holds constants fron the logger, which we'll be using in some of our -# commands. -lc = Constants() - class StandardCommonCommands(CommandContainer): """ This command container contains standard commands which are common @@ -104,10 +100,10 @@ class StandardCommonCommands(CommandContainer): raise CommandError(_("Limit must be an integer")) for row in results: - contact, time, kind, show, message, subject = row + contact, time, kind, show, message, subject, log_line_id = row if not contact: - if kind == lc.KIND_CHAT_MSG_SENT: + if kind == KindConstant.CHAT_MSG_SENT: contact = gajim.nicks[self.account] else: contact = self.contact.name View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c02260c4d18fece5541878e6635d7e4e0062319b...205f5f3044a93c50edb4f9cd1e03d0556d2bf1a9
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits