Commit 2f7436733aa2738de4b27d31a32c5885d5e75545

Authored by selurvedu
1 parent 006b0cce

Rename arguments in get_from_object()

... ... @@ -369,14 +369,14 @@ def set_access_key(tender, access_token):
369 369 return tender
370 370
371 371
372   -def get_from_object(obj, attribute):
  372 +def get_from_object(obj, path):
373 373 """Gets data from a dictionary using a dotted accessor-string"""
374   - jsonpath_expr = parse_path(attribute)
  374 + jsonpath_expr = parse_path(path)
375 375 return_list = [i.value for i in jsonpath_expr.find(obj)]
376 376 if return_list:
377 377 return return_list[0]
378 378 else:
379   - raise AttributeError('Attribute not found: {0}'.format(attribute))
  379 + raise AttributeError('Attribute not found: {0}'.format(path))
380 380
381 381
382 382 def set_to_object(obj, attribute, value):
... ...
Please register or login to post a comment