equal
deleted
inserted
replaced
38 target=target, |
38 target=target, |
39 transform=self.transform) |
39 transform=self.transform) |
40 return assignment + transform |
40 return assignment + transform |
41 |
41 |
42 |
42 |
43 FUNCTION_EXPRESSION = re.compile('(.+)\((.+)\)') |
43 FUNCTION_EXPRESSION = re.compile('(.+)\((.+)\)', re.MULTILINE | re.DOTALL) |
44 ARGUMENTS_EXPRESSION = re.compile('[^(,)]+') |
44 ARGUMENTS_EXPRESSION = re.compile('[^(,)]+') |
45 |
45 |
46 |
46 |
47 def render_extension(econtext, name): |
47 def render_extension(econtext, name): |
48 """TALES extension renderer |
48 """TALES extension renderer |
61 # may be a quoted string... |
61 # may be a quoted string... |
62 return arg[1:-1] |
62 return arg[1:-1] |
63 if '=' in arg: |
63 if '=' in arg: |
64 key, value = arg.split('=', 1) |
64 key, value = arg.split('=', 1) |
65 value = get_value(econtext, value) |
65 value = get_value(econtext, value) |
66 return {key: value} |
66 return {key.strip(): value} |
67 try: |
67 try: |
68 arg = int(arg) # check integer value |
68 arg = int(arg) # check integer value |
69 except ValueError: |
69 except ValueError: |
70 args = arg.split('.') |
70 args = arg.split('.') |
71 result = econtext.get(args.pop(0)) |
71 result = econtext.get(args.pop(0)) |