def insert(data, new): for d in new: if d in data: if data[d][SarBase.TYPE] != new[d][SarBase.TYPE]: Log.warning("ObjectConflit = %s (%s != %s)" % (d, data[d][TYPE], new[d][TYPE])) # else: data[d] = new[d] # # return data
def visit(path, key, value): if key is SarBase.OLINK: for l in value: try: update(data[l], {k: data[k][SarBase.TYPE]}) except: Log.warning("LinkNotFound = %s ( %s )" % (l, data[k][SarBase.TYPE])) # # # return True
def __call__(self): result = {} # find all arxml for f in self.__findFiles(): # prase and merge try: result = self.__mergeData(result, self.__parseFile(f)) except Exception as e: Log.warning("file=%s exception=%s" % (f, str(e))) # link data result = self.__linkData(result) return result