diff options
Diffstat (limited to 'cdsapi/api.py')
-rw-r--r-- | cdsapi/api.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cdsapi/api.py b/cdsapi/api.py index 9160916..4823bd6 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -149,6 +149,13 @@ class Client(object): logger = logging.getLogger('cdsapi') + def __enter__(self, **kwargs): + self.__init__(**kwargs) + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + pass + def __init__(self, url=os.environ.get('CDSAPI_URL'), key=os.environ.get('CDSAPI_KEY'), |