Added a new 'contrib' folder for optional code snippets not suitable for the server core. Added contrib/menusystem for implementing a multi-choice menu system. Added contrib/lineeditor - a powerful line editor with commands mimicking VI. Also added an example NPC class using the menu system to allow for a conversation. As part of creating these contributions, lots of bugs were found and fixed. A new and more powerful cmdparser was intruduced as a result - this one is much easier to understand than the old one, while being more efficient and versatile. All testsuites were updated. Also: Resolves issue 165.

This commit is contained in:
Griatch 2011-05-12 21:51:11 +00:00
parent 2c47d6a66b
commit b9c1921a0b
16 changed files with 1426 additions and 354 deletions

View file

@ -390,7 +390,9 @@ class CmdCreate(ObjManipCommand):
# (i.e. starts with game or src) we let it be, otherwise we
# add a base path as defined in settings
if typeclass and not (typeclass.startswith('src.') or
typeclass.startswith('game.')):
typeclass.startswith('game.') or
typeclass.startswith('contrib')):
typeclass = "%s.%s" % (settings.BASE_TYPECLASS_PATH,
typeclass)
@ -1477,13 +1479,13 @@ class CmdExamine(ObjManipCommand):
#self.caller.msg(db_attr)
string += headers["persistent"]
for attr, value in db_attr:
if crop:
if crop and isinstance(value, basestring):
value = utils.crop(value)
string += "\n %s = %s" % (attr, value)
if ndb_attr and ndb_attr[0]:
string += headers["nonpersistent"]
for attr, value in ndb_attr:
if crop:
if crop and isinstance(value, basestring):
value = utils.crop(value)
string += "\n %s = %s" % (attr, value)
return string