mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
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:
parent
2c47d6a66b
commit
b9c1921a0b
16 changed files with 1426 additions and 354 deletions
|
|
@ -52,12 +52,12 @@ def crop(text, width=78, suffix="[...]"):
|
|||
continues. Cropping will be done so that the suffix will also fit
|
||||
within the given width.
|
||||
"""
|
||||
ltext = len(str(text))
|
||||
ltext = len(to_str(text))
|
||||
if ltext <= width:
|
||||
return text
|
||||
else:
|
||||
lsuffix = len(suffix)
|
||||
return text[:width-lsuffix] + suffix
|
||||
return "%s%s" % (text[:width-lsuffix], suffix)
|
||||
|
||||
def dedent(text):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue