Spaces:
Running
Running
Update google_function.py
Browse files134 unmodified lines135136137138139140141142143144145146147148149150134 unmodified linesdef connetti_google():load_dotenv()json_variable_str = os.getenv("JSON_GOOGLE")with open("credentials.json", "w") as f:f.write(json_variable_str)creds = Noneif os.path.exists("token.json"):creds = Credentials.from_authorized_user_file("token.json", SCOPES)if not creds or not creds.valid:if creds and creds.expired and creds.refresh_token:creds.refresh(Request())else:flow = InstalledAppFlow.from_client_secrets_file("credentials.json", SCOPES)creds = flow.run_local_server(port=0)with open("token.json", "w") as token:token.write(creds.to_json())134 unmodified lines135136137138139140141142143144145146147148149150151152153154155134 unmodified linesdef connetti_google():load_dotenv()json_variable_str = os.getenv("JSON_GOOGLE")print(json_variable_str)with open("./credentials.json", "w") as f:f.write(json_variable_str)if os.path.exists("./credentials.json"):print('ESISTE')else:print('NON ESISTE')creds = Noneif os.path.exists("./token.json"):creds = Credentials.from_authorized_user_file("token.json", SCOPES)if not creds or not creds.valid:if creds and creds.expired and creds.refresh_token:creds.refresh(Request())else:flow = InstalledAppFlow.from_client_secrets_file("./credentials.json", SCOPES)creds = flow.run_local_server(port=0)with open("token.json", "w") as token:token.write(creds.to_json())
google_function.py+8-3