idZddlZdZdZdS)zJSONpath utility functions as needed within pysim. As pySim-sell has the ability to represent SIM files as JSON strings, adding JSONpath allows us to conveniently modify individual sub-fields of a file or record in its JSON representation. NcTtj|}||S)zFind/Match a JSON path within a given JSON-serializable dict. Args: js_dict : JSON-serializable dict to operate on js_path : JSONpath string Returns: Result of the JSONpath expression ) jsonpath_ngparsefind)js_dictjs_path jsonpath_exprs D/home/jenkins/jenkins/workspace/simtester-sanitize/pySim/jsonpath.py js_path_findr s( %g..M   g & &&ctj|}|||||dS)zFind/Match a JSON path within a given JSON-serializable dict. Args: js_dict : JSON-serializable dict to operate on js_path : JSONpath string new_val : New value for field in js_dict at js_path N)rrrupdate)rrnew_valr s r js_path_modifyr%sD %g..Mw'*****r )__doc__rr rr r rsE$''' + + + + +r