Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Implement Api.has_credentials()
Browse files Browse the repository at this point in the history
This patch allows the API object to report whether or not authentication
credentials was supplied upon object instantiation.

Releases version 6.4.0.
  • Loading branch information
kimtore committed Nov 17, 2016
1 parent ca2314c commit 680ee78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions productstatus/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ def delete_event_listener(self):
del self._event_listener
self._event_listener = None

def has_credentials(self):
"""!
@brief Returns True if a username and API key was supplied with the API
object constructor, False otherwise.
"""
return self._session.auth is not None

def _do_request(self, method, *args, **kwargs):
"""
Run a request through the requests API. This function wraps
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'author': 'MET Norway',
'url': 'https://github.com/metno/python-productstatus-client',
'download_url': 'https://github.com/metno/python-productstatus-client',
'version': '6.3.0',
'version': '6.4.0',
'install_requires': [
'nose==1.3.7',
'requests==2.9.1',
Expand Down

0 comments on commit 680ee78

Please sign in to comment.