speedyg0nz/MagInkCal

Quickstart.py may need a current directory declaration

Opened this issue · 1 comments

Hey @speedyg0nz. Just wanted to let you know of an error I ran into and the method I used to fix it. For some reason running the quickstart.py as is returned an error.

Adding this to line 22
CURR_DIR = os.path.dirname(os.path.realpath(__file__))

and changing line 39-41 from this:
flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server(port=0)

to this:
credential_file=str(CURR_DIR)+'/credentials.json' flow = InstalledAppFlow.from_client_secrets_file( credential_file, SCOPES) creds = flow.run_local_server(port=0)

That fixed the issue for me. Unfortunately, I'm having trouble replicating it now so I can't specify what the error it threw actually was. Apologies there. Starting from a fresh repo in a new environment doesn't have the issue at all. This is probably an edge case.
I think this is an environment thing but thought it worth sharing regardless in case anyone else encounters it in the future.

Confirmed.

Added/augmented the marked lines 25 & 39. After changing, the code now works.

image