Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

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