simpler @{} support

This commit is contained in:
Massimo Di Pierro
2012-04-19 22:51:08 -05:00
parent 0109ab141f
commit 1991189e71
2 changed files with 4 additions and 4 deletions

View File

@@ -1 +1 @@
Version 1.99.7 (2012-04-19 22:47:29) dev
Version 1.99.7 (2012-04-19 22:50:51) dev

View File

@@ -366,10 +366,10 @@ def render(text,extra={},allowed={},sep='p',URL=None,environment=None):
# this is experimental @{controller/index/args}
# turns into a digitally signed URL
def u1(match,URL=URL):
b,c = match.group('a'), match.group('b'), match.group('c')
return URL(b,args=c.split('/'),scheme=True,host=True)
f,args = match.group('f'), match.group('args')
return URL(f,args=args.split('/'),scheme=True,host=True)
text = re.compile(
'@\{(?P<a>\w+)/(?P<b>\w+)/(?P<c>.+?)\}'
'@\{(?P<f>\w+)/(?P<args>.+?)\}'
).sub(u1,text)
#############################################################