def pos_builder(self, current_pos): '''This function begin to declare new POS's sub-objects like publisher, topic and data. :param current_pos: dictionary -- The dictionary tree of current POS. ''' print 'begin' for pub in current_pos["pos"]: pub_obj = Publisher(pub["pub_id"], pub["pub_name"], pub["pub_topics"]) self.__add_publisher(pub_obj) for topic in pub["pub_topics"]: topic_obj = Topic(topic["id"], topic["name"], topic["version"], topic["metadata_path"], topic["data_list"]) for data in topic["data_list"]: metadata = topic_obj.read_metadata(topic["metadata_path"]) acc_folder = os.path.join(acc_loc, "acc") acc = self.acc_build(metadata, acc_folder) data_obj = PosData(metadata["data_name"], metadata["data_id"], metadata["data_desc"], acc) print 'end'