def __init__(self, data, output = sys.stdout, warnaction = "default", warngoal = sys.stderr, caller_id = 0):
DATAtree.__init__(self, output, warnaction, warngoal, caller_id)
with self.tree_lock:
self.tree_type ='json'
self.extract_from_parent = True
self.data = data
# Read the json data into the tree
try:
self.root = JSONnode(self, data, key = 'ROOT')
self.start_node = self.root
except:
self.warn('Unable to parse the JSON data. Invalid dataset!', dtDataWarning, 1)
self.start_node = NULLnode()
# end JSONtree
评论列表
文章目录