Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1744-1761 (lines=18) @@
1741
            'title': title,
1742
            'author': author,
1743
        }
1744
1745
1746
class BigFootJustice(GenericNavigableComic):
1747
    """Class to retrieve Big Foot Justice comics."""
1748
    # Also on http://tapastic.com/series/bigfoot-justice
1749
    name = 'bigfoot'
1750
    long_name = 'Big Foot Justice'
1751
    url = 'http://bigfootjustice.com'
1752
    get_first_comic_link = get_a_navi_navifirst
1753
    get_navi_link = get_a_navi_comicnavnext_navinext
1754
1755
    @classmethod
1756
    def get_comic_info(cls, soup, link):
1757
        """Get information about a particular comics."""
1758
        imgs = soup.find('div', id='comic').find_all('img')
1759
        assert all(i['title'] == i['alt'] for i in imgs)
1760
        title = ' '.join(i['title'] for i in imgs)
1761
        return {
1762
            'img': [i['src'] for i in imgs],
1763
            'title': title,
1764
        }
@@ 2626-2642 (lines=17) @@
2623
            'year': day.year,
2624
            'day': day.day,
2625
        }
2626
2627
2628
class BuniComic(GenericNavigableComic):
2629
    """Class to retrieve Buni Comics."""
2630
    name = 'buni'
2631
    long_name = 'BuniComics'
2632
    url = 'http://www.bunicomic.com'
2633
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2634
    get_navi_link = get_link_rel_next
2635
2636
    @classmethod
2637
    def get_comic_info(cls, soup, link):
2638
        """Get information about a particular comics."""
2639
        imgs = soup.find('div', id='comic').find_all('img')
2640
        assert all(i['alt'] == i['title'] for i in imgs)
2641
        assert len(imgs) == 1
2642
        return {
2643
            'img': [i['src'] for i in imgs],
2644
            'title': imgs[0]['title'],
2645
        }