def __init__(self, gspread_id=GSPREAD_ID, sheet_title=GSPREAD_SHEET_MAIN): self.json_key = utils.load_json_file(GSPREAD_TOKEN) self.credentials = SignedJwtAssertionCredentials(self.json_key['client_email'], self.json_key['private_key'], GSPREAD_SCOPE) self.initial = gspread.Client(auth=self.credentials) self.initial.login() self.spreadSheet = self.initial.open_by_key(gspread_id) self.worksheet = self.spreadSheet.worksheet(sheet_title) # or worksheet=spreadSheet.get_worksheet()[3]
def import_story_result(self, story_result_path): """ :param story_result_path: path to old result file :return: self.story_result """ self.story_result = utils.load_json_file(story_result_path)