How to use the icdiff.diff_files function in icdiff

To help you get started, we’ve selected a few icdiff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lab11 / eagle / scripts / eagle_bom_helper.py View on Github external
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:
#

icdiff

improved colored diff

Python-2.0
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Similar packages