예제 #1
0
파일: emote.py 프로젝트: ViKingIX/grailmud
def emoteToWrapper(actor, text, info):
    try:
        blob, text = emote_to_pattern.parseString(text)
    except ParseException:
        badSyntax()
        return
    try:
        target = get_from_rooms(blob, [actor.inventory, actor.room], info)
    except UnfoundError:
        unfoundObject()
        return
    text = text.replace('%', '%%')
    emoteTo(actor, target, 'You have emoted: ' + text, text, text)
예제 #2
0
 def test_bad_syntax_with_argument(self):
     arg = "foo"
     badSyntax(self.obj, arg)
     assert self.obj.delegate.received == [BadSyntaxEvent(arg)]
예제 #3
0
 def test_bad_syntax_without_argument(self):
     badSyntax(self.obj)
     assert self.obj.delegate.received == [BadSyntaxEvent(None)]