client.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pygsheets 作者: nithinmurali 项目源码 文件源码
def __init__(self, oauth, http_client=None, retries=1, no_cache=False):
        if no_cache:
            cache = None
        else:
            cache = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))

        self.oauth = oauth
        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")
        with open(os.path.join(data_path, "sheets_discovery.json")) as jd:
            self.service = discovery.build_from_document(jload(jd), http=http)
        with open(os.path.join(data_path, "drive_discovery.json")) as jd:
            self.driveService = discovery.build_from_document(jload(jd), http=http)
        self._spreadsheeets = []
        self.batch_requests = dict()
        self.retries = retries
        self.enableTeamDriveSupport = False  # if teamdrive files should be included
        self.teamDriveId = None  # teamdrive to search for spreadsheet
        self._fetch_sheets()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号