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

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

Issue 15009006: Docserver: refactor Servlet, ObjectStore, and ServerInstance architecture to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix example zipper 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 | Annotate | Revision Log
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=None):
9 self.path = path 9 self.path = path.lstrip('/')
10 if headers is None:
11 headers = {}
10 self.headers = headers 12 self.headers = headers
11 13
12 class _ContentBuilder(object): 14 class _ContentBuilder(object):
13 '''Builds the response content. 15 '''Builds the response content.
14 ''' 16 '''
15 def __init__(self): 17 def __init__(self):
16 self._buf = [] 18 self._buf = []
17 19
18 def Append(self, content): 20 def Append(self, content):
19 if isinstance(content, unicode): 21 if isinstance(content, unicode):
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 len(self.content), self.status, len(self.headers.keys())) 97 len(self.content), self.status, len(self.headers.keys()))
96 98
97 class Servlet(object): 99 class Servlet(object):
98 def __init__(self, request): 100 def __init__(self, request):
99 self._request = request 101 self._request = request
100 102
101 def Get(self): 103 def Get(self):
102 '''Returns a Response. 104 '''Returns a Response.
103 ''' 105 '''
104 raise NotImplemented() 106 raise NotImplemented()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698