Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def call_kipart(part_data_file):
"""Helper routine for calling kipart."""
return kipart(
reader_type=args.reader,
part_data_file=part_data_file,
parts_lib=parts_lib,
allow_overwrite=args.overwrite,
sort_type=args.sort,
reverse=args.reverse,
fuzzy_match=args.fuzzy_match,
bundle=args.bundle,
debug_level=args.debug,
)
DEFAULT_PIN.side = args.side
check_file_exists = True # Used to check for existence of a single output lib file.
for input_file in args.input_files:
# No explicit output lib file, so each individual input file will generate its own .lib file.
if check_file_exists or not args.output:
output_file = args.output or os.path.splitext(input_file)[0] + ".lib"
if os.path.isfile(output_file):
# The output lib file already exists.
if args.overwrite:
# Overwriting an existing file, so ignore the existing parts.
parts_lib = OrderedDict()
elif args.append:
# Appending to an existing file, so read in existing parts.
parts_lib = read_lib_file(output_file)