Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if rows_before == rows:
termcolor.cprint('No changes', attrs=['bold'])
print(dataprint.to_string(rows))
else:
with tempfile.NamedTemporaryFile(mode='w+t') as before, tempfile.NamedTemporaryFile(mode='w+t') as after:
# HACK for space of MPN entry on diff
rows_before[0][rows_before[0].index('MPN')] = '.' * 8 + 'MPN' + '.' * 8
rows[0][rows[0].index('MPN')] = '.' * 8 + 'MPN' + '.' * 8
dataprint.to_file(before, rows_before)
dataprint.to_file(after, rows)
before.flush()
after.flush()
options = icdiff.get_options()[0]
options.no_headers = True
icdiff.diff_files(options, before.name, after.name)
print('')
print()
r = input('Write updated Eagle files? [Y/n] ')
if len(r) and r[0].lower() == 'n':
sys.exit()
sch.write(sch_file)
brd.write(brd_file)
###############################################################################
## Try to reduce the Eagle file diff churn a little
# This is a bit obnoxious, but worth doing:
#