forked from youtify/youtify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sucks.py
27 lines (20 loc) · 1.1 KB
/
sucks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import webapp2
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp import util
class SuckyBrowserHandler(webapp2.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'html', 'yourbrowsersucks.html')
self.response.out.write(template.render(path, {
'ON_PRODUCTION': os.environ['SERVER_SOFTWARE'].startswith('Google App Engine'), # http://stackoverflow.com/questions/1916579/in-python-how-can-i-test-if-im-in-google-app-engine-sdk
}))
class RockyDecisionHandler(webapp2.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'html', 'yourdecisionrocks.html')
self.response.out.write(template.render(path, {
'ON_PRODUCTION': os.environ['SERVER_SOFTWARE'].startswith('Google App Engine'), # http://stackoverflow.com/questions/1916579/in-python-how-can-i-test-if-im-in-google-app-engine-sdk
}))
app = webapp2.WSGIApplication([
('/yourbrowsersucks', SuckyBrowserHandler),
('/yourdecisionrocks', RockyDecisionHandler),
], debug=True)