mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 02:06:32 +01:00
Fixed arg_regex inheritance across child commands. Resolves #601.
This commit is contained in:
parent
1bcd9abc6b
commit
8a9e1a9b4b
1 changed files with 6 additions and 6 deletions
|
|
@ -62,8 +62,6 @@ def _init_command(mcs, **kwargs):
|
|||
|
||||
if hasattr(mcs, 'arg_regex') and isinstance(mcs.arg_regex, basestring):
|
||||
mcs.arg_regex = re.compile(r"%s" % mcs.arg_regex, re.I)
|
||||
else:
|
||||
mcs.arg_regex = None
|
||||
if not hasattr(mcs, "auto_help"):
|
||||
mcs.auto_help = True
|
||||
if not hasattr(mcs, 'is_exit'):
|
||||
|
|
@ -140,14 +138,16 @@ class Command(object):
|
|||
locks = ""
|
||||
# used by the help system to group commands in lists.
|
||||
help_category = "general"
|
||||
|
||||
# This allows to turn off auto-help entry creation for individual commands.
|
||||
auto_help = True
|
||||
# optimization for quickly separating exit-commands from normal commands
|
||||
is_exit = False
|
||||
# define the command not only by key but by the regex form of its arguments
|
||||
arg_regex = None
|
||||
|
||||
# auto-set (by Evennia on command instantiation) are:
|
||||
# obj - which object this command is defined on
|
||||
# sessid - which session-id (if any) is responsible for
|
||||
# triggering this command
|
||||
#
|
||||
# sessid - which session-id (if any) is responsible for triggering this command
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
"""the lockhandler works the same as for objects.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue