1class DictQuery(dict):
2 def get(self, path, default = None):
3 keys = path.split("/")
4 val = None
5
6 for key in keys:
7 if val:
8 if isinstance(val, list):
9 val = [ v.get(key, default) if v else None for v in val]
10 else:
11 val = val.get(key, default)
12 else:
13 val = dict.get(self, key, default)
14
15 if not val:
16 break;
17
18 return val
19