@@ -265,20 +265,17 @@ def initiate_device_flow(self, scopes=None, **kwargs):
265265 scope = decorate_scope (scopes or [], self .client_id ),
266266 ** kwargs )
267267
268- def acquire_token_by_device_flow (
269- self , flow , exit_condition = lambda : True , ** kwargs ):
270- """Obtain token by a device flow object, with optional polling effect.
268+ def acquire_token_by_device_flow (self , flow , ** kwargs ):
269+ """Obtain token by a device flow object, with customizable polling effect.
271270
272271 Args:
273272 flow (dict):
274- An object previously generated by initiate_device_flow(...).
275- exit_condition (Callable):
276- This method implements a loop to provide polling effect.
277- The loop's exit condition is calculated by this callback.
278- The default callback makes the loop run only once, i.e. no polling.
273+ A dict previously generated by initiate_device_flow(...).
274+ You can exit the polling loop early, by changing the value of
275+ its "expires_at" key to 0, at any time.
279276 """
280277 return self .client .obtain_token_by_device_flow (
281- flow , exit_condition = exit_condition ,
278+ flow ,
282279 data = {"code" : flow ["device_code" ]}, # 2018-10-4 Hack:
283280 # during transition period,
284281 # service seemingly need both device_code and code parameter.
0 commit comments