From d00ff9ae3211360e9ae72449a296b579b7a8dfe8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Thu, 7 Apr 2016 19:48:11 +0200 Subject: [PATCH] Added dynamic formatting to comm channel, as inspired by the way done in Arxmush. --- evennia/comms/channelhandler.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/evennia/comms/channelhandler.py b/evennia/comms/channelhandler.py index 66acf74a52..621474cf1a 100644 --- a/evennia/comms/channelhandler.py +++ b/evennia/comms/channelhandler.py @@ -32,15 +32,13 @@ from django.utils.translation import ugettext as _ class ChannelCommand(command.Command): """ - Channel + {channelkey} channel Usage: - - - This is a channel. If you have subscribed to it, you can send to - it by entering its name or alias, followed by the text you want to - send. + {lower_channelkey} + {lower_channelkey} history [-] + {channeldesc} """ # this flag is what identifies this cmd as a channel cmd # and branches off to the system send-to-channel command @@ -179,6 +177,11 @@ class ChannelHandler(object): obj=channel, arg_regex=r"\s.*?", is_channel=True) + # format the help entry + key = channel.key + cmd.__doc__ = cmd.__doc__.format(channelkey=key, + lower_channelkey=key.strip().lower(), + channeldesc=channel.db.desc.strip()) self.cached_channel_cmds.append(cmd) self.cached_cmdsets = {}