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
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