Fixed up Tutorial world, which also led to weeding out a host of smaller things. Resolves Issue 216. Resolves Issue 335. Tutorial should now again be possible to complete. :)
This commit is contained in:
parent
c615693a2a
commit
d42949b324
6 changed files with 30 additions and 22 deletions
|
|
@ -383,19 +383,17 @@ def holds(accessing_obj, accessed_obj, *args, **kwargs):
|
|||
contents = accessing_obj.obj.contents
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
def check_holds(objid):
|
||||
# helper function. Compares both dbrefs and keys/aliases.
|
||||
objid = str(objid)
|
||||
dbref = utils.dbref(objid)
|
||||
dbref = utils.dbref(objid, reqhash=False)
|
||||
if dbref and any((True for obj in contents if obj.dbid == dbref)):
|
||||
return True
|
||||
objid = objid.lower()
|
||||
return any((True for obj in contents
|
||||
if obj.key.lower() == objid or objid in [al.lower() for al in obj.aliases]))
|
||||
|
||||
if not args:
|
||||
# holds() - check if accessed_obj is held by accessing_ob
|
||||
# holds() - check if accessed_obj or accessed_obj.obj is held by accessing_obj
|
||||
try:
|
||||
if check_holds(accessed_obj.dbid):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -221,8 +221,8 @@ class LockHandler(object):
|
|||
if not callable(func):
|
||||
elist.append(_("Lock: function '%s' is not available.") % funcstring)
|
||||
continue
|
||||
args = list(arg.strip() for arg in rest.split(',') if not '=' in arg)
|
||||
kwargs = dict([arg.split('=', 1) for arg in rest.split(',') if '=' in arg])
|
||||
args = list(arg.strip() for arg in rest.split(',') if arg and not '=' in arg)
|
||||
kwargs = dict([arg.split('=', 1) for arg in rest.split(',') if arg and '=' in arg])
|
||||
lock_funcs.append((func, args, kwargs))
|
||||
evalstring = evalstring.replace(funcstring, '%s')
|
||||
if len(lock_funcs) < nfuncs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue