Reverted previous merge, instead solving the issue by the metaclass making sure to add cmd:all() to the exit command only if the object itself does not specify it.

This commit is contained in:
Griatch 2013-07-02 11:51:04 +02:00
parent b41761f60c
commit 3cf01ce711
3 changed files with 5 additions and 4 deletions

View file

@ -48,7 +48,7 @@ def _init_command(mcs, **kwargs):
if not hasattr(mcs, 'locks'): if not hasattr(mcs, 'locks'):
# default if one forgets to define completely # default if one forgets to define completely
mcs.locks = "cmd:all()" mcs.locks = "cmd:all()"
elif not "cmd:" in mcs.locks: if not "cmd:" in mcs.locks:
mcs.locks = "cmd:all();" + mcs.locks mcs.locks = "cmd:all();" + mcs.locks
for lockstring in mcs.locks.split(';'): for lockstring in mcs.locks.split(';'):
if lockstring and not ':' in lockstring: if lockstring and not ':' in lockstring:

View file

@ -911,6 +911,7 @@ class Exit(Object):
# create an exit command. # create an exit command.
cmd = ExitCommand(key=exidbobj.db_key.strip().lower(), cmd = ExitCommand(key=exidbobj.db_key.strip().lower(),
aliases=exidbobj.aliases, aliases=exidbobj.aliases,
locks=str(exidbobj.locks),
auto_help=False, auto_help=False,
destination=exidbobj.db_destination, destination=exidbobj.db_destination,
obj=exidbobj) obj=exidbobj)