Fix for issue #17 (#18)

* Fix for issue #17
* Updating version (and) Adding Travis CI support
* Adding Build status to README
This commit is contained in:
Ramesh RV 2019-03-04 19:14:32 +05:30 committed by Russell Ballestrini
parent 8c4229944f
commit 0e8723b822
7 changed files with 128 additions and 27 deletions

View file

@ -113,9 +113,10 @@ def _get_occurrence(dictionary, item, keyword):
def recrusion(dictionary):
if item == 'key':
occurrence[0] += 1 if dictionary.get(keyword) else 0
elif keyword in dictionary.values():
occurrence[0] += dictionary.values().count(keyword)
if dictionary.get(keyword) is not None:
occurrence[0] += 1
elif keyword in list(dictionary.values()):
occurrence[0] += list(dictionary.values()).count(keyword)
for key, value in iteritems(dictionary):
if isinstance(value, dict):
recrusion(dictionary=value)