Skip to content

Commit

Permalink
#42 mention deprecation in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Jan 11, 2017
1 parent f39c25e commit e7bf297
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zign/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def load_config_ztoken(config_file: str):


def get_new_token(realm: str, scope: list, user, password, url=None, insecure=False):
'''"get_new_token" is deprecated, please use "zign.api.get_token" instead'''

if not url:
config = get_config(OLD_CONFIG_NAME)
url = config.get('url')
Expand Down Expand Up @@ -268,9 +270,10 @@ def get_token_implicit_flow(name=None, authorize_url=None, token_url=None, clien

def get_named_token(scope, realm, name, user, password, url=None,
insecure=False, refresh=False, use_keyring=True, prompt=False):
'''get named access token, return existing if still valid'''
import warnings
warnings.warn('"get_named_token" is deprecated, please use "zign.api.get_token" instead', DeprecationWarning)
'''get named access token, return existing if still valid
"get_named_token" is deprecated, please use "zign.api.get_token" instead
'''

access_token = get_token(name, scope)
return {'access_token': access_token}
Expand Down

0 comments on commit e7bf297

Please sign in to comment.