simpler @{} support

This commit is contained in:
Massimo Di Pierro
2012-04-19 22:47:52 -05:00
parent f7ecbc2dab
commit 0109ab141f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.7 (2012-04-19 22:33:54) dev
Version 1.99.7 (2012-04-19 22:47:29) dev
+2 -2
View File
@@ -366,8 +366,8 @@ 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):
a,b,c = match.group('a'), match.group('b'), match.group('c')
return URL(a,b,args=c.split('/'),scheme=True,host=True)
b,c = match.group('a'), match.group('b'), match.group('c')
return URL(b,args=c.split('/'),scheme=True,host=True)
text = re.compile(
'@\{(?P<a>\w+)/(?P<b>\w+)/(?P<c>.+?)\}'
).sub(u1,text)