#NEWLINE# def initialize( self , request , response ) : #NEWLINE# #INDENT# "\n        Initialize's this request's Facebook client.\n        " #NEWLINE# super ( FacebookRequestHandler , self ) . initialize ( request , response ) #NEWLINE# app_name = self . _fbconfig_value ( 'app_name' , '' ) #NEWLINE# api_key = self . _fbconfig_value ( 'api_key' , None ) #NEWLINE# secret_key = self . _fbconfig_value ( 'secret_key' , None ) #NEWLINE# self . facebook = Facebook ( api_key , secret_key , app_name = app_name ) #NEWLINE# require_app = self . _fbconfig_value ( 'require_app' , False ) #NEWLINE# require_login = self . _fbconfig_value ( 'require_login' , False ) #NEWLINE# need_session = self . _fbconfig_value ( 'need_session' , False ) #NEWLINE# check_session = self . _fbconfig_value ( 'check_session' , True ) #NEWLINE# self . _messages = None #NEWLINE# self . redirecting = False #NEWLINE# if ( require_app or require_login ) : #NEWLINE# #INDENT# if ( not self . facebook . check_session ( request ) ) : #NEWLINE# #INDENT# self . redirect ( self . facebook . get_login_url ( next = request . path ) ) #NEWLINE# self . redirecting = True #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if check_session : #NEWLINE# #INDENT# self . facebook . check_session ( need_session ) #NEWLINE# #UNINDENT# #UNINDENT# if ( require_app and ( not self . facebook . added ) ) : #NEWLINE# #INDENT# self . redirect ( self . facebook . get_add_url ( next = request . path ) ) #NEWLINE# self . redirecting = True #NEWLINE# return #NEWLINE# #UNINDENT# if ( ( not ( require_app or require_login ) ) and need_session ) : #NEWLINE# #INDENT# self . facebook . auth . getSession ( )