diff --git a/py/requirements.txt b/py/requirements.txt index ddf155b..c6bcb4a 100644 --- a/py/requirements.txt +++ b/py/requirements.txt @@ -1,2 +1,2 @@ semver >= 3.0 -jsonlogic-py == 0.2.1 \ No newline at end of file +jsonlogic-py == 0.2.1 diff --git a/py/src/clippy/backends/fs/__init__.py b/py/src/clippy/backends/fs/__init__.py index e49b2b7..2cfde7d 100644 --- a/py/src/clippy/backends/fs/__init__.py +++ b/py/src/clippy/backends/fs/__init__.py @@ -202,6 +202,12 @@ def m(self, *args, **kwargs): # .. add state # argdict[STATE_KEY] = self._state argdict[clippy_constants.STATE_KEY] = getattr(self, clippy_constants.STATE_KEY) + + # explicitly add loglevel to state if it doesn't already exist. + argdict[clippy_constants.STATE_KEY][clippy_constants.LOGLEVEL_KEY] = self.logger.getEffectiveLevel() + # Returns python integer that gets converted by cpp + + # ~ for key in statedesc: # ~ statej[key] = getattr(self, key) diff --git a/py/src/clippy/constants.py b/py/src/clippy/constants.py index acdc4e7..5bdbc49 100644 --- a/py/src/clippy/constants.py +++ b/py/src/clippy/constants.py @@ -23,7 +23,8 @@ REFERENCE_KEY = "references" # key to json entry that holds return data from backend functions. RETURN_KEY = "returns" - +# key inside STATE_KEY that provides state information for the loglevel +LOGLEVEL_KEY = "loglevel" # these keys are returned from the _help output when creating methods # for classes. diff --git a/test/run_ipython.sh b/test/run_ipython.sh new file mode 100755 index 0000000..849661c --- /dev/null +++ b/test/run_ipython.sh @@ -0,0 +1,6 @@ +#!/bin/sh +PROJ_ROOT_DIR=$(pwd)/.. +CPP_BUILD_DIR=$PROJ_ROOT_DIR/cpp/build +export PYTHONPATH=$PROJ_ROOT_DIR/py/src:$PYTHONPATH +export CLIPPY_BACKEND_PATH=$CPP_BUILD_DIR/examples +CLIPPY_LOGLEVEL=DEBUG ipython