parameters: (self)
docstring: Handler for GET requests.
docstring_summary: Handler for GET requests.
docstring_tokens: Handler for GET requests .
function: def get(self):
      """Handler for GET requests."""
      user = users.get_current_user()
      if user:
        if IS_PRODUCTION:
          # We should use federated_identity in production, since the license
          # server requires an OpenID
          userid = user.federated_identity()
        else:
          # On the dev server, we won't have access to federated_identity, so
          # just use a default OpenID which will never return YES.
          # If you want to test different response values on the development
          # server, just change this default value (e.g. append '-yes' or
          # '-trial').
          userid = ('https://www.google.com/accounts/o8/id?'
                    'id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
        license_data = parse_license_data(userid)
        template_data = {
          'license': license_data,
          'user_name': user.nickname(),
          'user_id': userid,
          'user_logout': users.create_logout_url(self.request.uri),
        }
      else:
        # Force the OpenID login endpoint to be for Google accounts only, since
        # the license server doesn't support any other type of OpenID provider.
        login_url = users.create_login_url(dest_url='/',
                        federated_identity='google.com/accounts/o8/id')
        template_data = {
          'user_login': login_url,
        }
  
      # Render a simple template
      path = os.path.join(os.path.dirname(__file__), 'templates', 'index.html')
      self.response.out.write(template.render(path, template_data))
function_tokens: def get ( self ) : user = users . get_current_user ( ) if user : if IS_PRODUCTION : # We should use federated_identity in production, since the license # server requires an OpenID userid = user . federated_identity ( ) else : # On the dev server, we won't have access to federated_identity, so # just use a default OpenID which will never return YES. # If you want to test different response values on the development # server, just change this default value (e.g. append '-yes' or # '-trial'). userid = ( 'https://www.google.com/accounts/o8/id?' 'id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ) license_data = parse_license_data ( userid ) template_data = { 'license' : license_data , 'user_name' : user . nickname ( ) , 'user_id' : userid , 'user_logout' : users . create_logout_url ( self . request . uri ) , } else : # Force the OpenID login endpoint to be for Google accounts only, since # the license server doesn't support any other type of OpenID provider. login_url = users . create_login_url ( dest_url = '/' , federated_identity = 'google.com/accounts/o8/id' ) template_data = { 'user_login' : login_url , } # Render a simple template path = os . path . join ( os . path . dirname ( __file__ ) , 'templates' , 'index.html' ) self . response . out . write ( template . render ( path , template_data ) )