Added safety feature to lock handling.
This commit is contained in:
parent
0164574c00
commit
5800b960ff
2 changed files with 2 additions and 1 deletions
|
|
@ -48,6 +48,8 @@ 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:
|
||||||
|
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:
|
||||||
lockstring = "cmd:%s" % lockstring
|
lockstring = "cmd:%s" % lockstring
|
||||||
|
|
|
||||||
|
|
@ -911,7 +911,6 @@ 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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue