Ok, once again, I’m probably doing something the hard way, but here it goes.
I was working with google calendar and one of the things I need to do was push an item onto the apps command line. To make sure this was working right, I printed out the argv list. As i repeatedly edited the argv list kept growing. I’m guessing I would use the terminate function to clean that up. Are there always the same args in the argv structure?
you know those days when you try the same search you tried last night on google and don’t get the same results. I wanted to include the link where they were talking about the arguments having to come from argv. But this morning I can’t find it.
self.flow = OAuth2WebServerFlow(self.client_id, self.client_secret, self.scope)
credentials = storage.get()
self.log("credentials={}".format(credentials))
# need to add this so we can create new credentials if needed
self.log("before argv={}".format(sys.argv))
sys.argv.append("noauth_local_webserver=True")
self.log("After argv={}".format(sys.argv))
# handle things if no credentials or invalid credentials are found
if credentials is None or credentials.invalid:
credentials = tools.run_flow(self.flow, self.storage, tools.argparser.parse_args())
Ok,
I may have found a way to insert the data using the argparser functions. The problem is it’s a standard python library that google appears to have overwritten and from what I’ve seen the jury is still out on whether it works or not.