diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-22 21:43:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-22 21:43:43 +0000 |
commit | 17fded63f9dba691d517f5c6952344d87d6338bf (patch) | |
tree | 524af7ee4fd4f9c6a0cf65bf98a7d397891d4049 /tools/scan-view | |
parent | 4d20cf759d96ac194ae27aa81cb127cd0619d0dd (diff) |
scan-view: Add header and "report bug" links to report pages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/scan-view')
-rw-r--r-- | tools/scan-view/ScanView.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py index f9a8cbd879..48b8cc80d0 100644 --- a/tools/scan-view/ScanView.py +++ b/tools/scan-view/ScanView.py @@ -14,7 +14,10 @@ import socket import Reporter import ConfigParser -# Keys replaced by server. +### +# Various patterns matched or replaced by server. + +kReportFileRE = re.compile('(.*/)?report-(.*)\\.html') kBugKeyValueRE = re.compile('<!-- BUG([^ ]*) (.*) -->') @@ -45,6 +48,12 @@ kReportReplacements.append((re.compile('<!-- REPORTBUG id="report-(.*)\\.html" - ('<td class="Button"><a href="report/\\1">Report Bug</a></td>' + '<td class="Button"><a href="javascript:load(\'open/\\1\')">Open File</a></td>'))) +kReportReplacements.append((re.compile('<!-- REPORTHEADER -->'), + '<h3><a href="/">Summary</a> > Report %(report)s</h3>')) + +kReportReplacements.append((re.compile('<!-- REPORTSUMMARYEXTRA -->'), + '<td class="Button"><a href="report/%(report)s">Report Bug</a></td>')) + ### # Other simple parameters @@ -570,6 +579,13 @@ File Bug</h3> return StringIO.StringIO(s) def send_patched_file(self, path, ctype): + # Allow a very limited set of variables. This is pretty gross. + variables = {} + variables['report'] = '' + m = kReportFileRE.match(path) + if m: + variables['report'] = m.group(2) + try: f = open(path,'r') except IOError: @@ -577,7 +593,7 @@ File Bug</h3> fs = os.fstat(f.fileno()) data = f.read() for a,b in kReportReplacements: - data = a.sub(b, data) + data = a.sub(b % variables, data) return self.send_string(data, ctype, mtime=fs.st_mtime) |