File: view_source.py

package info (click to toggle)
zope-cmfplone 2.5.1-4etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,752 kB
  • ctags: 5,237
  • sloc: python: 28,264; xml: 3,723; php: 129; makefile: 99; sh: 2
file content (9 lines) | stat: -rw-r--r-- 386 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
def getObjectSource(self, template_id=''):
    template = getattr(self, template_id, None)
    if template:
        self.REQUEST.RESPONSE.setHeader('content-type', 'text/plain')
        if hasattr(template, '_text'):
            return template._text
        if hasattr(template, 'document_src'): #dtml
            return template.document_src
    return 'source could not be rendered'