| #!/usr/bin/env python3 |
| |
| import argparse |
| |
| from pathlib import Path |
| |
| import common |
| from common import \ |
| lib_extract_from_name, \ |
| extract_version_and_lib_from_path, \ |
| copy_file_to_output, \ |
| \ |
| convert_libname, \ |
| convert_cell_fullname, \ |
| convert_pinname |
| |
| |
| def filemain(input_file, temp_dir, final_dir, args): |
| if 'V' not in input_file: |
| print("Skipping", input_file) |
| return |
| old_lib, new_lib, version = extract_version_and_lib_from_path(input_file) |
| |
| copy_file_to_output(input_file, final_dir, new_lib, version, 'techlef', filename=new_lib+'.tlef') |
| |
| |
| if __name__ == "__main__": |
| import doctest |
| fails, _ = doctest.testmod() |
| if fails != 0: |
| sys.exit("Some test failed") |
| parser = argparse.ArgumentParser() |
| parser.add_argument( |
| "input", |
| help="The path to the source directory/file", |
| type=Path) |
| parser.add_argument( |
| "output", |
| help="The path to the output directory", |
| type=Path) |
| parser.add_argument( |
| "temp", |
| help="The path to the temp directory", |
| type=Path) |
| args = parser.parse_args() |
| common.main('tlef', filemain, args) |