Example #1
0
    def compare(self, editions):
        key1 = editions[0]["key"]
        key2 = editions[1]["key"]
        try:
            (rec_amazon, rec_marc) = amazon_and_marc(key1, key2)
        except AssertionError:
            yield "must be one amazon and one marc edition"
            return
        yield "<h2>Level 1</h2>"
        l1 = merge_amazon.level1_merge(rec_amazon, rec_marc)
        for i in self.field_table(l1, rec_amazon, rec_marc):
            yield i

        yield "<h2>Level 2</h2>"
        l2 = merge_amazon.level2_merge(rec_amazon, rec_marc)
        for i in self.field_table(l2, rec_amazon, rec_marc):
            yield i
Example #2
0
    def amazon_compare(self, editions):
        key1 = editions[0]['key']
        key2 = editions[1]['key']
        try:
            (rec_amazon, rec_marc) = amazon_and_marc(key1, key2)
        except AssertionError:
            yield 'must be one amazon and one marc edition'
            return
        yield '<h2>Level 1</h2>'
        l1 = merge_amazon.level1_merge(rec_amazon, rec_marc)
        for i in self.field_table(l1, rec_amazon, rec_marc):
            yield i

        yield '<h2>Level 2</h2>'
        l2 = merge_amazon.level2_merge(rec_amazon, rec_marc)
        for i in self.field_table(l2, rec_amazon, rec_marc):
            yield i