191 if name == 'dev':
192 return self.handleDev()
193
194 elif name == 'login':
195 return self.handleLogin()
196
197 elif name == 'upload':
198 return self.handleUpload()
199
200 user = users.get_current_user()
201 prefs = UserData.get_by_key_name(user.user_id())
202 if prefs is None:
203 return self.handleLogin()
204
205 html = HtmlFile.get_by_key_name(name)
206 if html is None:
207 self.error(404)
208 return
209
210 self.response.headers['Content-Type'] = 'text/html'
211
212 if html.compressed:
213
214
215 gz = gzip.GzipFile(name,
216 'rb',
217 fileobj=StringIO.StringIO(html.content))
218 self.response.out.write(gz.read())
219 gz.close()
220 else:
221 self.response.out.write(html.content)
222
223
224
const myers::Point & get(const myers::Segment &)