From 285ab787da18cba973832280185122718380c54d Mon Sep 17 00:00:00 2001 From: "Xuan Hu (Sean)" Date: Wed, 17 May 2017 17:35:58 +0800 Subject: [PATCH] Bump version to 1.3.1. (#33) - Reorder class declaration. - Satisfy lint. - bug fix. --- cognitive_face/util.py | 25 +++++++++++++------------ setup.py | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cognitive_face/util.py b/cognitive_face/util.py index e758a56..76687b9 100644 --- a/cognitive_face/util.py +++ b/cognitive_face/util.py @@ -13,18 +13,6 @@ import cognitive_face as CF DEFAULT_BASE_URL = 'https://westus.api.cognitive.microsoft.com/face/v1.0/' -class BaseUrl(object): - - @classmethod - def set(cls, base_url): - cls.base_url = base_url - - @classmethod - def get(cls): - if not hasattr(cls, 'base_url'): - cls.base_url = DEFAULT_BASE_URL - return cls.base_url - TIME_SLEEP = 1 @@ -67,6 +55,19 @@ class Key(object): return cls.key +class BaseUrl(object): + + @classmethod + def set(cls, base_url): + cls.base_url = base_url + + @classmethod + def get(cls): + if not hasattr(cls, 'base_url') or not cls.base_url: + cls.base_url = DEFAULT_BASE_URL + return cls.base_url + + def request(method, url, data=None, json=None, headers=None, params=None): # pylint: disable=too-many-arguments """Universal interface for request.""" diff --git a/setup.py b/setup.py index 724e29b..e664c78 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def readme(): setup( name='cognitive_face', - version='1.3.0', + version='1.3.1', packages=find_packages(exclude=['tests']), install_requires=['requests'], author='Microsoft',