<s> """<STR_LIT>""" <EOL> CURRENT_UPDATE_CHECK_ID = <NUM_LIT:4> <EOL> update_check_needed = False <EOL> try : <EOL> if CANARY_UPDATE_CHECK_ID != CURRENT_UPDATE_CHECK_ID : <EOL> update_check_needed = True <EOL> except NameError : <EOL> update_check_needed = True <EOL> appname = request . application <EOL> if update_check_needed : <EOL> import s3cfg <EOL> settings = s3cfg . S3Config ( ) <EOL> from s3_update_check import update_check <EOL> errors = [ ] <EOL> warnings = [ ] <EOL> messages = update_check ( settings ) <EOL> errors . extend ( messages . get ( "<STR_LIT>" , [ ] ) ) <EOL> warnings . extend ( messages . get ( "<STR_LIT>" , [ ] ) ) <EOL> try : <EOL> import s3 as s3base <EOL> except Exception , e : <EOL> errors . append ( e . message ) <EOL> import sys <EOL> if warnings : <EOL> prefix = "<STR_LIT>" % T ( "<STR_LIT>" ) <EOL> msg = prefix + prefix . join ( warnings ) <EOL> print >> sys . stderr , msg <EOL> if errors : <EOL> actionrequired = T ( "<STR_LIT>" ) <EOL> prefix = "<STR_LIT>" % actionrequired <EOL> msg = prefix + prefix . join ( errors ) <EOL> print >> sys . stderr , msg <EOL> htmlprefix = "<STR_LIT>" % actionrequired <EOL> html = "<STR_LIT>" + htmlprefix + htmlprefix . join ( errors ) + "<STR_LIT>" <EOL> raise HTTP ( <NUM_LIT> , body = html ) <EOL> from gluon import portalocker <EOL> canary = open ( "<STR_LIT>" % appname , "<STR_LIT:w>" ) <EOL> portalocker . lock ( canary , portalocker . LOCK_EX ) <EOL> statement = "<STR_LIT>" % CURRENT_UPDATE_CHECK_ID <EOL> canary . write ( statement ) <EOL> canary . close ( ) <EOL> import os <EOL> try : <EOL> from collections import OrderedDict <EOL> except : <EOL> from gluon . contrib . simplejson . ordered_dict import OrderedDict <EOL> from gluon import current <EOL> from gluon . storage import Storage <EOL> response . s3 = Storage ( ) <EOL> s3 = response . s3 <EOL> s3 . gis = Storage ( ) <EOL> current . cache = cache <EOL> current . MAX_FILENAME_LENGTH = <NUM_LIT:255> <EOL> import s3cfg <EOL> settings = s3cfg . S3Config ( ) <EOL> current . deployment_settings = deployment_settings = settings </s>
