#NEWLINE# def GetSite( ) : #NEWLINE# #INDENT# site = memcache . get ( 'site' ) #NEWLINE# if ( site is not None ) : #NEWLINE# #INDENT# return site #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# q = db . GqlQuery ( 'SELECT * FROM Site WHERE num = 1' ) #NEWLINE# if ( q . count ( ) == 1 ) : #NEWLINE# #INDENT# site = q [ 0 ] #NEWLINE# if ( site . l10n is None ) : #NEWLINE# #INDENT# site . l10n = 'en' #NEWLINE# #UNINDENT# if ( site . meta is None ) : #NEWLINE# #INDENT# site . meta = '' #NEWLINE# #UNINDENT# memcache . set ( 'site' , site , 86400 ) #NEWLINE# return site #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# site = Site ( ) #NEWLINE# site . num = 1 #NEWLINE# site . title = 'V2EX' #NEWLINE# site . domain = 'v2ex.appspot.com' #NEWLINE# site . slogan = 'way to explore' #NEWLINE# site . l10n = 'en' #NEWLINE# site . description = '' #NEWLINE# site . meta = '' #NEWLINE# site . put ( ) #NEWLINE# memcache . set ( 'site' , site , 86400 ) #NEWLINE# return site