Added context manager
This commit is contained in:
parent
3395ddc9e3
commit
69f0a5454c
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user