def __call__ (self): global map_file # TODO: objectify the Yaml file and line number handling into this class, and away from globals map_file = self.root yaml_docs = [d for d in ordered_load_all (open (self.root))] print yaml_docs [0] print '- - -' if len(yaml_docs) ==2: print yaml_docs[1] assert len (yaml_docs) == 1 self.dct = yaml_docs [0] Operations.__call__ (self)
def __call__(self): global map_file # TODO: objectify the Yaml file and line number handling into this class, and away from globals map_file = self.root yaml_docs = [d for d in ordered_load_all(open(self.root))] print yaml_docs[0] print '- - -' if len(yaml_docs) == 2: print yaml_docs[1] assert len(yaml_docs) == 1 self.dct = yaml_docs[0] Operations.__call__(self)
def __call__ (self): global map_file # TODO: objectify the Yaml file and line number handling into this class, and away from globals map_file = self.root self.root = Template (self.root).safe_substitute (config) yaml_docs = [d for d in ordered_load_all (open (self.root))] for yaml_doc in yaml_docs: if yaml_doc and not 'ignore' in yaml_doc: for k,v in yaml_doc.items(): if trace: print 'key:', k if k == "config": update_config (v) else: ops = construct_operations (k,v) if ops: ops() else: declarations.update ([(k,v)])