# Path: meld/matchers.py
# def init_worker():
# def matcher_worker(text1, textn):
# def find_common_prefix(a, b):
# def find_common_suffix(a, b):
#     def __init__(self, isjunk=None, a="", b=""):
#     def get_matching_blocks(self):
#     def get_opcodes(self):
#     def get_difference_opcodes(self):
#     def preprocess_remove_prefix_suffix(self, a, b):
#     def preprocess_discard_nonmatching_lines(self, a, b):
#         def index_matching(a, b):
#     def preprocess(self):
#     def postprocess(self):
#     def build_matching_blocks(self, lastsnake):
#     def initialise(self):
#     def preprocess_discard_nonmatching_lines(self, a, b):
#         def index_matching_kmers(a, b):
#     def __init__(self, isjunk=None, a="", b="", syncpoints=None):
#     def initialise(self):
# class MyersSequenceMatcher(difflib.SequenceMatcher):
# class InlineMyersSequenceMatcher(MyersSequenceMatcher):
# class SyncPointMyersSequenceMatcher(MyersSequenceMatcher):


import gobject
from .matchers import DiffChunk, MyersSequenceMatcher, \
    SyncPointMyersSequenceMatcher

### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.

### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.

### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
### USA.




opcode_reverse = {
    "replace": "replace",
    "insert": "delete",
    "delete": "insert",
    "conflict": "conflict",
    "equal": "equal"
}


def reverse_chunk(chunk):
    tag = opcode_reverse[chunk[0]]

# Path: meld/matchers.py
# def init_worker():
# def matcher_worker(text1, textn):
# def find_common_prefix(a, b):
# def find_common_suffix(a, b):
#     def __init__(self, isjunk=None, a="", b=""):
#     def get_matching_blocks(self):
#     def get_opcodes(self):
#     def get_difference_opcodes(self):
#     def preprocess_remove_prefix_suffix(self, a, b):
#     def preprocess_discard_nonmatching_lines(self, a, b):
#         def index_matching(a, b):
#     def preprocess(self):
#     def postprocess(self):
#     def build_matching_blocks(self, lastsnake):
#     def initialise(self):
#     def preprocess_discard_nonmatching_lines(self, a, b):
#         def index_matching_kmers(a, b):
#     def __init__(self, isjunk=None, a="", b="", syncpoints=None):
#     def initialise(self):
# class MyersSequenceMatcher(difflib.SequenceMatcher):
# class InlineMyersSequenceMatcher(MyersSequenceMatcher):
# class SyncPointMyersSequenceMatcher(MyersSequenceMatcher):


# Path: meld/diffutil.py
import gobject
from .matchers import DiffChunk, MyersSequenceMatcher, \
    SyncPointMyersSequenceMatcher


### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.

### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.

### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
### USA.




opcode_reverse = {
    "replace": "replace",
    "insert": "delete",
    "delete": "insert",
    "conflict": "conflict",
    "equal": "equal"
}


def reverse_chunk(chunk):
    tag = opcode_reverse[chunk[0]]

    return DiffChunk._make((tag, chunk[3], chunk[4], chunk[1], chunk[2]))