Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1804-1821 (lines=18) @@
1801
1802
class BigFootJustice(GenericNavigableComic):
1803
    """Class to retrieve Big Foot Justice comics."""
1804
    # Also on http://tapastic.com/series/bigfoot-justice
1805
    name = 'bigfoot'
1806
    long_name = 'Big Foot Justice'
1807
    url = 'http://bigfootjustice.com'
1808
    get_first_comic_link = get_a_navi_navifirst
1809
    get_navi_link = get_a_navi_comicnavnext_navinext
1810
1811
    @classmethod
1812
    def get_comic_info(cls, soup, link):
1813
        """Get information about a particular comics."""
1814
        imgs = soup.find('div', id='comic').find_all('img')
1815
        assert all(i['title'] == i['alt'] for i in imgs)
1816
        title = ' '.join(i['title'] for i in imgs)
1817
        return {
1818
            'img': [i['src'] for i in imgs],
1819
            'title': title,
1820
        }
1821
1822
1823
class RespawnComic(GenericNavigableComic):
1824
    """Class to retrieve Respawn Comic."""
@@ 2785-2801 (lines=17) @@
2782
2783
class BuniComic(GenericNavigableComic):
2784
    """Class to retrieve Buni Comics."""
2785
    name = 'buni'
2786
    long_name = 'BuniComics'
2787
    url = 'http://www.bunicomic.com'
2788
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2789
    get_navi_link = get_link_rel_next
2790
2791
    @classmethod
2792
    def get_comic_info(cls, soup, link):
2793
        """Get information about a particular comics."""
2794
        imgs = soup.find('div', id='comic').find_all('img')
2795
        assert all(i['alt'] == i['title'] for i in imgs)
2796
        assert len(imgs) == 1
2797
        return {
2798
            'img': [i['src'] for i in imgs],
2799
            'title': imgs[0]['title'],
2800
        }
2801
2802
2803
class GenericCommitStrip(GenericNavigableComic):
2804
    """Generic class to retrieve Commit Strips in different languages."""