diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e928de1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class \ No newline at end of file diff --git a/cas_wrapper.py b/cas_wrapper.py index 8533dc9..3e1cffa 100644 --- a/cas_wrapper.py +++ b/cas_wrapper.py @@ -64,6 +64,7 @@ class CasWrapper: def authenticate( self, local_path: str, + return_json: bool = False, ): """ Wrapper around `cas authenticate` @@ -71,7 +72,8 @@ class CasWrapper: (should be started from `git://`) or to a single local file :return: true if a commit is trusted, vice versa - false - :rtype: bool + or dict with result if return_json param is True + :rtype: bool or dict """ command = self._cas[ 'authenticate', @@ -92,4 +94,7 @@ class CasWrapper: ): # in case if commit is untrusted result_of_execution = command(retcode=1) - return not bool(json.loads(result_of_execution)['status']) + json_result = json.loads(result_of_execution) + if return_json: + return json_result + return not bool(json_result['status']) diff --git a/setup.py b/setup.py index d7c772d..f19dd49 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="cas_wrapper", - version="0.0.1", + version="0.0.2", author="Stepan Oksanichenko", author_email="soksanichenko@almalinux.org", description="The python wrapper around binary cas from "