Permalink
Browse files

Q: What time is it? A: 40,000 lines of python shall tell you

  • Loading branch information...
1 parent 887f95d commit 715ce477517a58135adce916295c811db8271f46 @dustball dustball committed Apr 28, 2012
Showing 587 changed files with 3,601 additions and 6 deletions.
View
@@ -6,6 +6,8 @@
from google.appengine.dist import use_library
use_library('django', '1.2')
+import pytz
+from datetime import datetime
from django.utils import simplejson
from google.appengine.api import memcache
from google.appengine.api import urlfetch
@@ -21,6 +23,7 @@
CACHE_ENABLED = True
CDN_ENABLED = True
CDN_HOSTNAME = 'http://cdn.hackerdojo.com'
+LOCAL_TZ = 'America/Los_Angeles'
if os.environ['SERVER_SOFTWARE'].startswith('Dev'):
CACHE_ENABLED = False
@@ -60,7 +63,11 @@ def post(self):
class IndexHandler(webapp.RequestHandler):
def get(self):
- staff = _request('http://hackerdojo-signin.appspot.com/staffjson')
+ utc_now = pytz.utc.localize(datetime.utcnow())
+ local_now = utc_now.astimezone(pytz.timezone(LOCAL_TZ))
+ hour = local_now.hour
+ if hour > 8 and hour < 22:
+ open = True
version = os.environ['CURRENT_VERSION_ID']
if CDN_ENABLED:
cdn = CDN_HOSTNAME
Oops, something went wrong.

0 comments on commit 715ce47

Please sign in to comment.