def main(): chpl_home = os.environ.get('CHPL_HOME') test_dir = os.path.join(chpl_home, 'test') ann_path = os.path.join(test_dir, 'ANNOTATIONS.yaml') ann_data = annotate.load(ann_path) graph_list = get_graph_names(test_dir) check_graph_names(ann_data, graph_list) try_parsing_annotations(ann_data, graph_list) check_configs(ann_data) check_pr_number_dates(ann_data) print("\nNo fatal annotation errors detected")
def main(): chpl_home = os.environ.get('CHPL_HOME') test_dir = os.path.join(chpl_home, 'test') ann_path=os.path.join(test_dir, 'ANNOTATIONS.yaml') ann_data = annotate.load(ann_path) graph_list = get_graph_names(test_dir) check_graph_names(ann_data, graph_list) try_parsing_annotations(ann_data, graph_list) check_configs(ann_data) check_pr_number_dates(ann_data) print("\nNo fatal annotation errors detected")
def init(self): if os.path.exists(self.outdir): if verbose: sys.stdout.write('Removing old directory %s...\n'%(self.outdir)) try: shutil.rmtree(self.outdir) except OSError: sys.stderr.write('Error: Could not clean up directory: %s\n'%(self.outdir)) raise if verbose: sys.stdout.write('Creating directory %s...\n'%(self.outdir)) try: os.makedirs(self.outdir) except OSError: sys.stderr.write('ERROR: Could not (re)create directory: %s\n'%(self.outdir)) raise if verbose: sys.stdout.write('Creating directory %s...\n'%(self.datdir)) try: os.makedirs(self.datdir) except OSError: sys.stderr.write('ERROR: Could not create directory: %s\n'%(self.datdir)) raise try: self.gfile = open(self.gfname, 'w') except IOError: sys.stderr.write('ERROR: Could not open file: %s\n'%(self.gfname)) if annotate and self.annotation_file: try: self.all_annotations = annotate.load(self.annotation_file) except IOError: sys.stderr.write('ERROR: Could not open file: %s\n'%(self.annotation_file)) raise else: self.all_annotations = None self.gfile.write('// AUTOMATICALLY GENERATED GRAPH DESCRIPTION\n') self.gfile.write('document.title = "%s";\n'%(self.title)) self.gfile.write('var pageTitle = "%s";\n'%(self.title)) runDate = time.strftime('%Y-%m-%d', time.localtime()) self.gfile.write('var runDate= "%s";\n'%(runDate)) self.gfile.write('var numericX = %s;\n'%(str(numericX).lower())) self.gfile.write('var configurations = [%s];\n' %(', '.join([ '" ('+conf+')"' for conf in multiConf]))) self.gfile.write('var configurationsVis = [%s];\n' %(', '.join([ '"('+conf+')"' for conf in defaultMultiConf]))) self.gfile.write('var allGraphs = [\n') self.firstGraph = True return 0
def main(): """ Parse and do some basic validation of the ANNOTATIONS.yaml file """ chpl_home = get_chpl_home() test_dir = os.path.join(chpl_home, 'test') ann_path = os.path.join(test_dir, 'ANNOTATIONS.yaml') with warnings.catch_warnings(record=True) as warnings_list: ann_data = annotate.load(ann_path) graph_list = get_graph_names(test_dir) check_graph_names(ann_data, graph_list) try_parsing_annotations(ann_data, graph_list) check_configs(ann_data) check_pr_number_dates(ann_data) for warning in warnings_list: print(warning.message) print('No fatal annotation errors detected') return len(warnings_list) != 0