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

Side by Side Diff: chrome/common/extensions/docs/server2/servlet.py

Issue 14125010: Docserver: Add support for viewing docs with a codereview patch applied (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 class Request(object): 5 class Request(object):
6 '''Request data. 6 '''Request data.
7 ''' 7 '''
8 def __init__(self, path, headers): 8 def __init__(self, path, headers):
9 self.path = path 9 self.path = path
10 self.headers = headers 10 self.headers = headers
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 self.headers[key] = value 83 self.headers[key] = value
84 84
85 def AddHeaders(self, headers): 85 def AddHeaders(self, headers):
86 '''Adds several headers to the response. 86 '''Adds several headers to the response.
87 ''' 87 '''
88 self.headers.update(headers) 88 self.headers.update(headers)
89 89
90 def SetStatus(self, status): 90 def SetStatus(self, status):
91 self.status = status 91 self.status = status
92 92
93 def IsRedirect(self):
94 return 'Location' in self.headers
95
93 def __repr__(self): 96 def __repr__(self):
94 return '{content: %s bytes, status: %s, headers: %s entries}' % ( 97 return '{content: %s bytes, status: %s, headers: %s entries}' % (
95 len(self.content), self.status, len(self.headers.keys())) 98 len(self.content), self.status, len(self.headers.keys()))
96 99
97 class Servlet(object): 100 class Servlet(object):
98 def __init__(self, request): 101 def __init__(self, request):
99 self._request = request 102 self._request = request
100 103
101 def Get(self): 104 def Get(self):
102 '''Returns a Response. 105 '''Returns a Response.
103 ''' 106 '''
104 raise NotImplemented() 107 raise NotImplemented()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698