Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py

Issue 1846093002: Revert of Remove unused imports in webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2011 Google Inc. All rights reserved. 1 # Copyright (c) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 13 matching lines...) Expand all
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 import BaseHTTPServer 29 import BaseHTTPServer
30 30
31 import cgi 31 import cgi
32 import codecs 32 import codecs
33 import datetime 33 import datetime
34 import fnmatch
34 import json 35 import json
35 import mimetypes 36 import mimetypes
36 import os.path 37 import os.path
37 import shutil 38 import shutil
38 import threading 39 import threading
39 import time 40 import time
41 import urlparse
40 import wsgiref.handlers 42 import wsgiref.handlers
41 import BaseHTTPServer 43 import BaseHTTPServer
42 44
43 45
44 class ReflectionHandler(BaseHTTPServer.BaseHTTPRequestHandler): 46 class ReflectionHandler(BaseHTTPServer.BaseHTTPRequestHandler):
45 STATIC_FILE_EXTENSIONS = ['.js', '.css', '.html'] 47 STATIC_FILE_EXTENSIONS = ['.js', '.css', '.html']
46 # Subclasses should override. 48 # Subclasses should override.
47 STATIC_FILE_DIRECTORY = None 49 STATIC_FILE_DIRECTORY = None
48 50
49 # Setting this flag to True causes the server to send 51 # Setting this flag to True causes the server to send
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if not headers_only: 143 if not headers_only:
142 shutil.copyfileobj(static_file, self.wfile) 144 shutil.copyfileobj(static_file, self.wfile)
143 145
144 def _serve_xml(self, xml): 146 def _serve_xml(self, xml):
145 self.send_response(200) 147 self.send_response(200)
146 self._send_access_control_header() 148 self._send_access_control_header()
147 self.send_header("Content-type", "text/xml") 149 self.send_header("Content-type", "text/xml")
148 self.end_headers() 150 self.end_headers()
149 xml = xml.encode('utf-8') 151 xml = xml.encode('utf-8')
150 self.wfile.write(xml) 152 self.wfile.write(xml)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698