parameters: (self, target_plugin, path)
docstring: Parses the path, extracts a token, and looks up a target
          for that token using the token plugin. Sets
          target_host and target_port if successful
docstring_summary: Parses the path, extracts a token, and looks up a target
          for that token using the token plugin. Sets
          target_host and target_port if successful
docstring_tokens: Parses the path extracts a token and looks up a target for that token using the token plugin . Sets target_host and target_port if successful
function: def get_target(self, target_plugin, path):
          """
          Parses the path, extracts a token, and looks up a target
          for that token using the token plugin. Sets
          target_host and target_port if successful
          """
          # The files in targets contain the lines
          # in the form of token: host:port
  
          # Extract the token parameter from url
          args = parse_qs(urlparse(path)[4]) # 4 is the query from url
  
          if not 'token' in args or not len(args['token']):
              raise self.server.EClose("Token not present")
  
          token = args['token'][0].rstrip('\n')
  
          result_pair = target_plugin.lookup(token)
  
          if result_pair is not None:
              return result_pair
          else:
              raise self.server.EClose("Token '%s' not found" % token)
function_tokens: def get_target ( self , target_plugin , path ) : # The files in targets contain the lines # in the form of token: host:port # Extract the token parameter from url args = parse_qs ( urlparse ( path ) [ 4 ] ) # 4 is the query from url if not 'token' in args or not len ( args [ 'token' ] ) : raise self . server . EClose ( "Token not present" ) token = args [ 'token' ] [ 0 ] . rstrip ( '\n' ) result_pair = target_plugin . lookup ( token ) if result_pair is not None : return result_pair else : raise self . server . EClose ( "Token '%s' not found" % token )