Fixed error in language format input.
This commit is contained in:
parent
3eca82ae3b
commit
8ff1cf91dc
1 changed files with 3 additions and 2 deletions
|
|
@ -137,7 +137,7 @@ _RE_CHAREND = re.compile(r"\W+$", _RE_FLAGS)
|
||||||
_RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+")
|
_RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+")
|
||||||
# language says in the emote are on the form "..." or langname"..." (no spaces).
|
# 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.
|
# 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:
|
# the emote parser works in two steps:
|
||||||
# 1) convert the incoming emote into an intermediary
|
# 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
|
# in-place without messing up indexes for future matches
|
||||||
# note that saytext includes surrounding "...".
|
# note that saytext includes surrounding "...".
|
||||||
langname, saytext = say_match.groups()
|
langname, saytext = say_match.groups()
|
||||||
|
print "lang match:", langname, saytext
|
||||||
istart, iend = say_match.start(), say_match.end()
|
istart, iend = say_match.start(), say_match.end()
|
||||||
# the key is simply the running match in the emote
|
# the key is simply the running match in the emote
|
||||||
key = "##%i" % imatch
|
key = "##%i" % imatch
|
||||||
|
|
@ -1240,7 +1241,7 @@ class ContribRPCharacter(DefaultCharacter, ContribRPObject):
|
||||||
the evennia.contrib.rplanguage module.
|
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
|
#from evennia.contrib import rplanguage
|
||||||
#return "{w%s{n" % rplanguage.obfuscate_language(text, level=1.0)
|
#return "{w%s{n" % rplanguage.obfuscate_language(text, level=1.0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue