Skip to content

Commit

Permalink
Pass PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehg committed Oct 9, 2015
1 parent 80be1a5 commit b2654cc
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions medium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, application_id=None, application_secret=None,
self.application_secret = application_secret
self.access_token = access_token


def get_authorization_url(self, state, redirect_url, scopes):
"""Get a URL for users to authorize the application.
Expand All @@ -37,7 +36,6 @@ def get_authorization_url(self, state, redirect_url, scopes):

return "https://medium.com/m/oauth/authorize?" + urlencode(qs)


def exchange_authorization_code(self, code, redirect_url):
"""Exchange the authorization code for a long-lived access token, and
set the token on the current Client.
Expand All @@ -64,7 +62,6 @@ def exchange_authorization_code(self, code, redirect_url):
}
return self._request_and_set_auth_code(data)


def exchange_refresh_token(self, refresh_token):
"""Exchange the supplied refresh token for a new access token, and
set the token on the current Client.
Expand All @@ -88,7 +85,6 @@ def exchange_refresh_token(self, refresh_token):
}
return self._request_and_set_auth_code(data)


def get_current_user(self):
"""Fetch the data for the currently authenticated user.
Expand All @@ -104,7 +100,6 @@ def get_current_user(self):
"""
return self._request("GET", "/v1/me")


def create_post(self, user_id, title, content, content_format, tags=None,
canonical_url=None, publish_status=None, license=None):
"""Create a post for the current user.
Expand Down Expand Up @@ -161,14 +156,12 @@ def create_post(self, user_id, title, content, content_format, tags=None,
path = "/v1/users/%s/posts" % user_id
return self._request("POST", path, json=data)


def _request_and_set_auth_code(self, data):
"""Request an access token and set it on the current client."""
result = self._request("POST", "/v1/tokens", form_data=data)
self.access_token = result["access_token"]
return result


def _request(self, method, path, json=None, form_data=None, files=None):
"""Make a signed request to the given route."""
url = BASE_PATH + path
Expand Down

0 comments on commit b2654cc

Please sign in to comment.