How to use the icdiff.codec_print 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 Juniper / jsnapy / lib / jnpr / jsnapy / check.py View on Github external
if check_from_sqlite:
            lines_a = pre_snap_file.splitlines(True)
            lines_b = post_snap_file.splitlines(True)
            headers = ("Snap_1", "Snap_2")
            options = get_options()[0]
            cd = ConsoleDiff(cols=int(options.cols),
                     show_all_spaces=options.show_all_spaces,
                     highlight=options.highlight,
                     no_bold=options.no_bold,
                     line_numbers=options.line_numbers,
                     tabsize=int(options.tabsize))
            for line in cd.make_table(
                    lines_a, lines_b, headers[0], headers[1],
                    context=(not options.whole_file),
                    numlines=int(options.unified)):
                codec_print(line, options)
                sys.stdout.flush()
        else:
            if os.path.isfile(pre_snap_file) and os.path.isfile(
                    post_snap_file):
                diff(pre_snap_file, post_snap_file)
            else:
                self.logger_check.info(
                    colorama.Fore.RED +
                    "ERROR!!! Files are not present in given path", extra=self.log_detail)
github Juniper / jsnapy / lib / jnpr / jsnapy / check.py View on Github external
if check_from_sqlite:
            lines_a = pre_snap_file.splitlines(True)
            lines_b = post_snap_file.splitlines(True)
            headers = ("Snap_1", "Snap_2")
            options = get_options()[0]
            cd = ConsoleDiff(cols=int(options.cols),
                     show_all_spaces=options.show_all_spaces,
                     highlight=options.highlight,
                     no_bold=options.no_bold,
                     line_numbers=options.line_numbers,
                     tabsize=int(options.tabsize))
            for line in cd.make_table(
                    lines_a, lines_b, headers[0], headers[1],
                    context=(not options.whole_file),
                    numlines=int(options.unified)):
                codec_print(line, options)
                sys.stdout.flush()
        else:
            if os.path.isfile(pre_snap_file) and os.path.isfile(
                    post_snap_file):
                diff(pre_snap_file, post_snap_file)
            else:
                self.logger_check.info(
                    colorama.Fore.RED +
                    "ERROR!!! Files are not present in given path", extra=self.log_detail)

icdiff

improved colored diff

Python-2.0
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Similar packages