Skip to content

Commit 68f3086

Browse files
committed
Minor updates
Add proper link to README.md Updated a couple of typos in comments. Remove suggestion to use private property in example.py
1 parent 947fc23 commit 68f3086

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#OX3-Python-API-Client - Python class to access OpenX Enterprise API
2-
OX3-Python-API-Client is a small class to help demonstrate how to connect to the OpenX Enterprise API. It depends on the [simplegeo/python-oauth2] module.
2+
OX3-Python-API-Client is a small class to help demonstrate how to connect to the OpenX Enterprise API. It depends on the [simplegeo/python-oauth2](https://github.com/simplegeo/python-oauth2) module.
33

44
It currently supports Python 2.7 and will be updated to support Python 3.x.

example.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,11 @@
2929
#
3030
# token_str = ox.fetch_access_token()
3131
# access_token = urlparse.parse_qs(token_str)['oauth_token'][0]
32-
#
33-
#
34-
# Alternatively, after calling fetch_access_token you can grab it off the
35-
# "private" _token property like:
36-
#
37-
# access_token = ox._token.key
38-
#
3932
#
4033
ox.validate_session()
4134

4235
# Or manually validate your access token (but you will be resonpsible for
43-
# passing the requisite openx3_access_token for all successive API requests.
36+
# passing the requisite openx3_access_token for all successive API requests).
4437
# token_str = ox.fetch_access_token()
4538
# access_token = urlparse.parse_qs(token_str)['oauth_token'][0]
4639
# cookie_header = {'Cookie': 'openx3_access_token=' + access_token}

ox3apiclient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _sign_request(self, req):
8686
self._consumer,
8787
self._token)
8888

89-
# Update or original requests headers to include the OAuth Authorization
89+
# Update our original requests headers to include the OAuth Authorization
9090
# header and return it.
9191
req.headers.update(oauth_req.to_header(realm=self.realm))
9292
return \
@@ -120,7 +120,7 @@ def request(self, url, method='GET', headers={}, data=None, sign=False):
120120
def fetch_request_token(self):
121121
"""Helper method to fetch and set request token.
122122
123-
Returns oauth2.Token object.
123+
Returns token string.
124124
"""
125125
res = self.request(url=self.request_token_url, method='POST', sign=True)
126126
self._token = oauth.Token.from_string(res.read())
@@ -145,7 +145,7 @@ def authorize_token(self, email, password):
145145
def fetch_access_token(self):
146146
"""Helper method to fetch and set access token.
147147
148-
Returns oauth2.Token object.
148+
Returns token string.
149149
"""
150150
res = self.request(url=self.access_token_url, method='POST', sign=True)
151151
self._token = oauth.Token.from_string(res.read())

0 commit comments

Comments
 (0)