diff options
Diffstat (limited to 'pygerrit/__init__.py')
-rw-r--r-- | pygerrit/__init__.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pygerrit/__init__.py b/pygerrit/__init__.py index cb77bdc..100380b 100644 --- a/pygerrit/__init__.py +++ b/pygerrit/__init__.py @@ -1,7 +1,13 @@ """ Module to interface with Gerrit. """ -from pygerrit.error import * -from pygerrit.events import * -from pygerrit.models import * -from pygerrit.stream import * +def from_json(json_data, key): + """ Helper method to extract values from JSON data. + + Return the value of `key` from `json_data`, or None if `json_data` + does not contain `key`. + + """ + if key in json_data: + return json_data[key] + return None |