Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1824-1841 (lines=18) @@
1821
class BigFootJustice(GenericNavigableComic):
1822
    """Class to retrieve Big Foot Justice comics."""
1823
    # Also on http://tapastic.com/series/bigfoot-justice
1824
    name = 'bigfoot'
1825
    long_name = 'Big Foot Justice'
1826
    url = 'http://bigfootjustice.com'
1827
    get_first_comic_link = get_a_navi_navifirst
1828
    get_navi_link = get_a_navi_comicnavnext_navinext
1829
1830
    @classmethod
1831
    def get_comic_info(cls, soup, link):
1832
        """Get information about a particular comics."""
1833
        imgs = soup.find('div', id='comic').find_all('img')
1834
        assert all(i['title'] == i['alt'] for i in imgs)
1835
        title = ' '.join(i['title'] for i in imgs)
1836
        return {
1837
            'img': [i['src'] for i in imgs],
1838
            'title': title,
1839
        }
1840
1841
1842
class RespawnComic(GenericNavigableComic):
1843
    """Class to retrieve Respawn Comic."""
1844
    # Also on https://respawncomic.tumblr.com
@@ 2837-2853 (lines=17) @@
2834
class BuniComic(GenericNavigableComic):
2835
    """Class to retrieve Buni Comics."""
2836
    name = 'buni'
2837
    long_name = 'BuniComics'
2838
    url = 'http://www.bunicomic.com'
2839
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2840
    get_navi_link = get_link_rel_next
2841
2842
    @classmethod
2843
    def get_comic_info(cls, soup, link):
2844
        """Get information about a particular comics."""
2845
        imgs = soup.find('div', id='comic').find_all('img')
2846
        assert all(i['alt'] == i['title'] for i in imgs)
2847
        assert len(imgs) == 1, imgs
2848
        return {
2849
            'img': [i['src'] for i in imgs],
2850
            'title': imgs[0]['title'],
2851
        }
2852
2853
2854
class GenericCommitStrip(GenericNavigableComic):
2855
    """Generic class to retrieve Commit Strips in different languages."""
2856
    get_navi_link = get_a_rel_next