Пример #1
0
 def sheetName(self, url):
     
   sheet="BASICIMPORT"
   
   offset=0
 
   if url.find('?') > -1:
     sheet = url.split('?')[1]
     offset = url.split('?')[2]
     
     sheet = urllib.url2pathname( sheet )
    
   return sheet, offset
Пример #2
0
def TokenFromUrl(url):
    """Extracts the AuthSub token from the URL.

  Returns the raw token value.

  Args:
    url: str The URL or the query portion of the URL string (after the ?) of
        the current page which contains the AuthSub token as a URL parameter.
  """
    if url.find('?') > -1:
        query_params = url.split('?')[1]
    else:
        query_params = url
    for pair in query_params.split('&'):
        if pair.startswith('token='):
            return pair[6:]
    return None
Пример #3
0
def TokenFromUrl(url):
  """Extracts the AuthSub token from the URL.

  Returns the raw token value.

  Args:
    url: str The URL or the query portion of the URL string (after the ?) of
        the current page which contains the AuthSub token as a URL parameter.
  """
  if url.find('?') > -1:
    query_params = url.split('?')[1]
  else:
    query_params = url
  for pair in query_params.split('&'):
    if pair.startswith('token='):
      return pair[6:]
  return None