From 8ff1cf91dc44a0ccc6353d5e7769d8d65405b7ab Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 26 Sep 2015 23:26:07 +0200 Subject: [PATCH] Fixed error in language format input. --- evennia/contrib/rpsystem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evennia/contrib/rpsystem.py b/evennia/contrib/rpsystem.py index 3f836a3c38..3b740681a7 100644 --- a/evennia/contrib/rpsystem.py +++ b/evennia/contrib/rpsystem.py @@ -137,7 +137,7 @@ _RE_CHAREND = re.compile(r"\W+$", _RE_FLAGS) _RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+") # language says in the emote are on the form "..." or langname"..." (no spaces). # this regex returns in groups (langname, say), where langname can be empty. -_RE_LANGUAGE = re.compile(r"(?:(\w+))*(\".+?\")") +_RE_LANGUAGE = re.compile(r"(?:\((\w+)\))*(\".+?\")") # the emote parser works in two steps: # 1) convert the incoming emote into an intermediary @@ -260,6 +260,7 @@ def parse_language(speaker, emote): # in-place without messing up indexes for future matches # note that saytext includes surrounding "...". langname, saytext = say_match.groups() + print "lang match:", langname, saytext istart, iend = say_match.start(), say_match.end() # the key is simply the running match in the emote key = "##%i" % imatch @@ -1240,7 +1241,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject): the evennia.contrib.rplanguage module. """ - return "{w%s{n" % text + return "%s{w%s{n" % ("{W(%s)" % language if language else "", text) #from evennia.contrib import rplanguage #return "{w%s{n" % rplanguage.obfuscate_language(text, level=1.0)