def __init__(self, credentials, retries=3, http=None, check=True, seconds_per_quota=100): self.oauth = credentials self.logger = logging.getLogger(__name__) http = AuthorizedHttp(credentials, http=http) data_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") self.sheet = SheetAPIWrapper(http, data_path, retries=retries, check=check, seconds_per_quota=seconds_per_quota) self.drive = DriveAPIWrapper(http, data_path)
def __init__(self, credentials, retries=3): self.oauth = credentials self.logger = logging.getLogger(__name__) http = AuthorizedHttp(credentials) data_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") self.sheet = SheetAPIWrapper(http, data_path, retries=retries) self.drive = DriveAPIWrapper(http, data_path)
def __init__(self, oauth, http_client=None, retries=3, no_cache=False): if no_cache: cache = None else: cache = os.path.join(tempfile.gettempdir(), str(uuid.uuid4())) if os.name == "nt": cache = "\\\\?\\" + cache self.oauth = oauth self.logger = logging.getLogger(__name__) http_client = http_client or httplib2.Http(cache=cache, timeout=20) http = self.oauth.authorize(http_client) data_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") self.sheet = SheetAPIWrapper(http, data_path, retries=retries) self.drive = DriveAPIWrapper(http, data_path)