コード例 #1
0
 def getChild(self, path, req):
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)
コード例 #2
0
 def getChild(self, path, req):
     if path == '':
         return Redirect('..')
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 if html5lib and ET and hasattr(log, 'html'):
                     return HTMLLog(log)
                 return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)
コード例 #3
0
ファイル: logs.py プロジェクト: thuanbk2010/katana
 def getChild(self, path, req):
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 content = log.getText()
                 is_html_log = isinstance(log, HTMLLogFile)
                 if is_html_log and log.content_type == 'json':
                     return JSONTestResource(log, self.step_status)
                 elif is_html_log and (log.content_type == 'xml' or
                                       ('xml-stylesheet' in content
                                        or 'nosetests' in content)):
                     return XMLTestResource(log, self.step_status)
                 else:
                     return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)