示例#1
0
def diff(from_file, to_file, page=0, output=None):
	extension = get_extension(from_file)

	if get_extension(to_file) != extension:
		log.error("%s: both files should have the same extension" % (to_file,))
		return

	if extension == 'brd':
		diff_visual(from_file, to_file, page, output)
	elif extension == 'sch':
		diff_visual(from_file, to_file, page, output)
	elif extension == 'lbr':
		diff_text(from_file, to_file)
	else:
		log.error("%s: skipping, not a board or schematic" % (from_file,))
		return
示例#2
0
def diff(from_file, to_file, page=0, output=None, semantic=False):
    extension = get_extension(from_file)

    if get_extension(to_file) != extension:
        log.error("%s: both files should have the same extension" %
                  (to_file, ))
        return

    if extension == 'brd':
        diff_visual(from_file, to_file, page, output)
    elif extension == 'sch':
        diff_visual(from_file, to_file, page, output)
    elif extension == 'lbr':
        if semantic or config.SEMANTIC_DIFF:
            diff_text(from_file, to_file)
        else:
            diff_semantic(from_file, to_file)
    else:
        log.error("%s: skipping, not a board or schematic" % (from_file, ))
        return