def process_directory(dir_path, analyzer=stopeight_clibs_legacy.stroke_parallel): tprinter = tableau_printer.tPrinter("parser.out", 6) lines = [] files = find_files(dir_path) count = 0 for final_path in files: log.info("Loading file " + final_path + "... ") try: graph = stopeight_clibs_legacy.parse_file(final_path) count += 1 tprinter.draw(graph) try: points = analyzer(graph) tprinter.draw(points) try: lines.append(numpy.array(points)) except: log.info("Cast from Analyzer Failed") log.info("Success") except: log.info("Analyzer Failed") tprinter.text("#" + str(count) + f + " failed.") except: log.info("Loading Failed") tprinter.text("Extracted " + str(len(lines)) + " Comparator lines out of " + str(count) + " readable Graph files.") tprinter.write() return lines
import os from stopeight.analyzer.TCT_printer import TCTPrinter if __name__=='__main__': import os print(os.getcwd()) import stopeight_clibs_legacy myprinter = TCTPrinter('line_printer2.out') fileline = stopeight_clibs_legacy.parse_file('../stopeight-clibs/legacy/tests.local/stage3-build04-authWorking/almostStraightLeg.sp') myprinter.lines(fileline) fileline = stopeight_clibs_legacy.stroke_sequential(fileline) fileline = stopeight_clibs_legacy.TCT_to_bezier(fileline) myprinter.TCTs(fileline) myprinter.write()