diff --git a/cas_wrapper.py b/cas_wrapper.py index 3e1cffa..e4bd8af 100644 --- a/cas_wrapper.py +++ b/cas_wrapper.py @@ -30,6 +30,18 @@ class CasWrapper: self._cas = local['cas'] self._cas['login']() + def __enter__(self): + with local.env( + CAS_API_KEY=self._cas_api_key, + SIGNER_ID=self._cas_signer_id, + ): + self._cas = local['cas'] + self._cas['login']() + return self + + def __exit__(self, exc_type, value, traceback): + self._cas['logout']() + def notarize( self, local_path: str,