Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1778-1795 (lines=18) @@
1775
            'title': title,
1776
            'author': author,
1777
        }
1778
1779
1780
class BigFootJustice(GenericNavigableComic):
1781
    """Class to retrieve Big Foot Justice comics."""
1782
    # Also on http://tapastic.com/series/bigfoot-justice
1783
    name = 'bigfoot'
1784
    long_name = 'Big Foot Justice'
1785
    url = 'http://bigfootjustice.com'
1786
    get_first_comic_link = get_a_navi_navifirst
1787
    get_navi_link = get_a_navi_comicnavnext_navinext
1788
1789
    @classmethod
1790
    def get_comic_info(cls, soup, link):
1791
        """Get information about a particular comics."""
1792
        imgs = soup.find('div', id='comic').find_all('img')
1793
        assert all(i['title'] == i['alt'] for i in imgs)
1794
        title = ' '.join(i['title'] for i in imgs)
1795
        return {
1796
            'img': [i['src'] for i in imgs],
1797
            'title': title,
1798
        }
@@ 2707-2723 (lines=17) @@
2704
            'year': day.year,
2705
            'day': day.day,
2706
        }
2707
2708
2709
class BuniComic(GenericNavigableComic):
2710
    """Class to retrieve Buni Comics."""
2711
    name = 'buni'
2712
    long_name = 'BuniComics'
2713
    url = 'http://www.bunicomic.com'
2714
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2715
    get_navi_link = get_link_rel_next
2716
2717
    @classmethod
2718
    def get_comic_info(cls, soup, link):
2719
        """Get information about a particular comics."""
2720
        imgs = soup.find('div', id='comic').find_all('img')
2721
        assert all(i['alt'] == i['title'] for i in imgs)
2722
        assert len(imgs) == 1
2723
        return {
2724
            'img': [i['src'] for i in imgs],
2725
            'title': imgs[0]['title'],
2726
        }