Pregunta

How are you supposed to set this programatically for the oauth2 module? I have tried the following, but get a key error:

from oauth2client.client import OAuth2Credentials
import gflags

gflags.FLAGS['--positional_parameters_enforcement'] = 'EXCEPTION'
¿Fue útil?

Solución 2

More reliably, this can be set in the following way:

import oauth2client.util
oauth2client.util.positional_parameter_enforcement = \
    oauth2client.util.POSITIONAL_IGNORE

from oauth2client.client import OAuth2Credentials

Otros consejos

After consulting help(glfags.Flag) I identified that you set the value property like so:

import gflags

gflags['positional_parameters_enforcement'].value = 'EXCEPTION'

Excellent! Although, now contrary to the documentation, the warnings are being suppressed and I have no exceptions.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top