aboutsummaryrefslogtreecommitdiff
path: root/tools/scan-view/ScanView.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-22 01:40:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-22 01:40:14 +0000
commit7345e4782e1218255cad13e7bab5f8104463500d (patch)
tree817cb31ae3a2487fb682b7750386243cb6b6af1f /tools/scan-view/ScanView.py
parent7cba11262458df05951432b54997eb40a35dbf9e (diff)
scan-view tweaks
- Use more correct HTTP error codes on (unexpected) errors. - Use onLoad to set ensure bug submission method gets set correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/scan-view/ScanView.py')
-rw-r--r--tools/scan-view/ScanView.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py
index 90437772a5..6b70b283ba 100644
--- a/tools/scan-view/ScanView.py
+++ b/tools/scan-view/ScanView.py
@@ -176,9 +176,6 @@ class ScanViewRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
self.copyfile(f, self.wfile)
f.close()
- def send_internal_error(self, message):
- return self.send_string('ERROR: %s'%(message,), 'text/plain')
-
def submit_bug(self):
title = self.fields.get('title')
description = self.fields.get('description')
@@ -278,7 +275,7 @@ class ScanViewRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
try:
keys = self.load_report(report)
except IOError:
- return self.send_internal_error('Invalid report.')
+ return self.send_error(400, 'Invalid report.')
initialTitle = keys.get('DESC','')
initialDescription = """\
@@ -338,7 +335,7 @@ function updateReporterOptions() {
}
}
</script>
-<body>
+<body onLoad="updateReporterOptions()">
<h1>File Report</h1>
<form name="form" action="/report_submit" method="post">
<input type="hidden" name="report" value="%(report)s">
@@ -478,7 +475,10 @@ function updateReporterOptions() {
return StringIO.StringIO(s)
def send_patched_file(self, path, ctype):
- f = open(path,'r')
+ try:
+ f = open(path,'r')
+ except IOError:
+ return self.send_404()
fs = os.fstat(f.fileno())
data = f.read()
for a,b in kReportReplacements: