Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 4027:39ad32d47cfb
Catch missing page template errors.
| author | Stefan Seefeld <stefan@seefeld.name> |
|---|---|
| date | Mon, 09 Feb 2009 19:18:47 +0000 |
| parents | 0112e9e1d068 |
| children | 82213b1971b4 |
comparison
equal
deleted
inserted
replaced
| 4026:c8b0a23ba38d | 4027:39ad32d47cfb |
|---|---|
| 890 def renderContext(self): | 890 def renderContext(self): |
| 891 ''' Return a PageTemplate for the named page | 891 ''' Return a PageTemplate for the named page |
| 892 ''' | 892 ''' |
| 893 name = self.classname | 893 name = self.classname |
| 894 extension = self.template | 894 extension = self.template |
| 895 pt = self.instance.templates.get(name, extension) | |
| 896 | 895 |
| 897 # catch errors so we can handle PT rendering errors more nicely | 896 # catch errors so we can handle PT rendering errors more nicely |
| 898 args = { | 897 args = { |
| 899 'ok_message': self.ok_message, | 898 'ok_message': self.ok_message, |
| 900 'error_message': self.error_message | 899 'error_message': self.error_message |
| 901 } | 900 } |
| 902 try: | 901 try: |
| 902 pt = self.instance.templates.get(name, extension) | |
| 903 # let the template render figure stuff out | 903 # let the template render figure stuff out |
| 904 result = pt.render(self, None, None, **args) | 904 result = pt.render(self, None, None, **args) |
| 905 self.additional_headers['Content-Type'] = pt.content_type | 905 self.additional_headers['Content-Type'] = pt.content_type |
| 906 if self.env.get('CGI_SHOW_TIMING', ''): | 906 if self.env.get('CGI_SHOW_TIMING', ''): |
| 907 if self.env['CGI_SHOW_TIMING'].upper() == 'COMMENT': | 907 if self.env['CGI_SHOW_TIMING'].upper() == 'COMMENT': |
