Skip to content

Commit

Permalink
fix Blogger authentication warning on the deprecation of oauth2client…
Browse files Browse the repository at this point in the history
….tools.run by switching [1] to run_flow

The warnging text is:

    WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library.

[1]: pandas-dev/pandas#8327 (comment)
  • Loading branch information
livibetter committed May 28, 2015
1 parent 6da9097 commit d43690f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ CHANGES
Development
===========

* fix Blogger authentication warning on the deprecation of ``oauth2client.tools.run`` by switching_ to ``run_flow``.

.. _switching: https://github.com/pydata/pandas/issues/8327#issuecomment-97282417

Version 0.9.0 (2014-09-09T03:06:03Z)
====================================

Expand Down
6 changes: 3 additions & 3 deletions bpy/services/blogger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2013-2014 by Yu-Jie Lin
# Copyright (C) 2013-2015 by Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -71,7 +71,7 @@
from apiclient.discovery import build
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.file import Storage as BaseStorage
from oauth2client.tools import run
from oauth2client.tools import run_flow, argparser

API_STORAGE = 'b.dat'

Expand Down Expand Up @@ -123,7 +123,7 @@ def auth(self):
storage = Storage(API_STORAGE)
credentials = storage.get()
if credentials is None or credentials.invalid:
credentials = run(FLOW, storage)
credentials = run_flow(FLOW, storage, argparser.parse_args([]))

http = httplib2.Http()
self.http = credentials.authorize(http)
Expand Down

0 comments on commit d43690f

Please sign in to comment.