Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1777-1794 (lines=18) @@
1774
1775
class BigFootJustice(GenericNavigableComic):
1776
    """Class to retrieve Big Foot Justice comics."""
1777
    # Also on http://tapastic.com/series/bigfoot-justice
1778
    name = 'bigfoot'
1779
    long_name = 'Big Foot Justice'
1780
    url = 'http://bigfootjustice.com'
1781
    get_first_comic_link = get_a_navi_navifirst
1782
    get_navi_link = get_a_navi_comicnavnext_navinext
1783
1784
    @classmethod
1785
    def get_comic_info(cls, soup, link):
1786
        """Get information about a particular comics."""
1787
        imgs = soup.find('div', id='comic').find_all('img')
1788
        assert all(i['title'] == i['alt'] for i in imgs)
1789
        title = ' '.join(i['title'] for i in imgs)
1790
        return {
1791
            'img': [i['src'] for i in imgs],
1792
            'title': title,
1793
        }
1794
1795
1796
class RespawnComic(GenericNavigableComic):
1797
    """Class to retrieve Respawn Comic."""
@@ 2730-2746 (lines=17) @@
2727
2728
class BuniComic(GenericNavigableComic):
2729
    """Class to retrieve Buni Comics."""
2730
    name = 'buni'
2731
    long_name = 'BuniComics'
2732
    url = 'http://www.bunicomic.com'
2733
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2734
    get_navi_link = get_link_rel_next
2735
2736
    @classmethod
2737
    def get_comic_info(cls, soup, link):
2738
        """Get information about a particular comics."""
2739
        imgs = soup.find('div', id='comic').find_all('img')
2740
        assert all(i['alt'] == i['title'] for i in imgs)
2741
        assert len(imgs) == 1
2742
        return {
2743
            'img': [i['src'] for i in imgs],
2744
            'title': imgs[0]['title'],
2745
        }
2746
2747
2748
class GenericCommitStrip(GenericNavigableComic):
2749
    """Generic class to retrieve Commit Strips in different languages."""