From 61f8992fbffac936ac058b64ed7ac00f21127df9 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 28 Oct 2012 22:18:06 +1300 Subject: Change response spec format to code[:features] Reason message is now specified as just another feature with the "m" mnemonic. --- libpathod/language.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libpathod/language.py') diff --git a/libpathod/language.py b/libpathod/language.py index 7f1d8cec..76676517 100644 --- a/libpathod/language.py +++ b/libpathod/language.py @@ -586,7 +586,8 @@ class Reason(_Component): @classmethod def expr(klass): - e = Value.copy() + e = pp.Literal("m").suppress() + e = e + Value return e.setParseAction(lambda x: klass(*x)) def values(self, settings): @@ -724,7 +725,8 @@ class Response(Message): InjectAt, ShortcutContentType, ShortcutLocation, - Raw + Raw, + Reason ) logattrs = ["code", "reason", "version", "body"] def __init__(self): @@ -749,7 +751,6 @@ class Response(Message): resp = pp.And( [ Code.expr(), - pp.Optional(Reason.expr()), pp.ZeroOrMore(Sep + atom) ] ) -- cgit v1.2.3