Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 4728:4caa6de726a5
templating: Rename 'extension' argument in Loader.load() to 'view'
to avoid confusion with file extension, and because this is what
this argument really does - specifies a different view for a class.
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Mon, 14 Jan 2013 00:13:58 +0300 |
| parents | 5033c2ad80a7 |
| children | 94be76e04140 |
comparison
equal
deleted
inserted
replaced
| 4727:5033c2ad80a7 | 4728:4caa6de726a5 |
|---|---|
| 1065 | 1065 |
| 1066 def renderContext(self): | 1066 def renderContext(self): |
| 1067 """ Return a PageTemplate for the named page | 1067 """ Return a PageTemplate for the named page |
| 1068 """ | 1068 """ |
| 1069 name = self.classname | 1069 name = self.classname |
| 1070 extension = self.template | 1070 view = self.template |
| 1071 | 1071 |
| 1072 # catch errors so we can handle PT rendering errors more nicely | 1072 # catch errors so we can handle PT rendering errors more nicely |
| 1073 args = { | 1073 args = { |
| 1074 'ok_message': self.ok_message, | 1074 'ok_message': self.ok_message, |
| 1075 'error_message': self.error_message | 1075 'error_message': self.error_message |
| 1076 } | 1076 } |
| 1077 try: | 1077 try: |
| 1078 pt = self.instance.templates.load(name, extension) | 1078 pt = self.instance.templates.load(name, view) |
| 1079 # let the template render figure stuff out | 1079 # let the template render figure stuff out |
| 1080 result = pt.render(self, None, None, **args) | 1080 result = pt.render(self, None, None, **args) |
| 1081 self.additional_headers['Content-Type'] = pt.content_type | 1081 self.additional_headers['Content-Type'] = pt.content_type |
| 1082 if self.env.get('CGI_SHOW_TIMING', ''): | 1082 if self.env.get('CGI_SHOW_TIMING', ''): |
| 1083 if self.env['CGI_SHOW_TIMING'].upper() == 'COMMENT': | 1083 if self.env['CGI_SHOW_TIMING'].upper() == 'COMMENT': |
