Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1732-1749 (lines=18) @@
1729
            'author': author,
1730
        }
1731
1732
1733
class BigFootJustice(GenericNavigableComic):
1734
    """Class to retrieve Big Foot Justice comics."""
1735
    # Also on http://tapastic.com/series/bigfoot-justice
1736
    name = 'bigfoot'
1737
    long_name = 'Big Foot Justice'
1738
    url = 'http://bigfootjustice.com'
1739
    get_first_comic_link = get_a_navi_navifirst
1740
    get_navi_link = get_a_navi_comicnavnext_navinext
1741
1742
    @classmethod
1743
    def get_comic_info(cls, soup, link):
1744
        """Get information about a particular comics."""
1745
        imgs = soup.find('div', id='comic').find_all('img')
1746
        assert all(i['title'] == i['alt'] for i in imgs)
1747
        title = ' '.join(i['title'] for i in imgs)
1748
        return {
1749
            'img': [i['src'] for i in imgs],
1750
            'title': title,
1751
        }
1752
@@ 2616-2632 (lines=17) @@
2613
        return {
2614
            'title': title,
2615
            'img': [i['src'] for i in imgs],
2616
            'month': day.month,
2617
            'year': day.year,
2618
            'day': day.day,
2619
        }
2620
2621
2622
class BuniComic(GenericNavigableComic):
2623
    """Class to retrieve Buni Comics."""
2624
    name = 'buni'
2625
    long_name = 'BuniComics'
2626
    url = 'http://www.bunicomic.com'
2627
    get_first_comic_link = get_a_comicnavbase_comicnavfirst
2628
    get_navi_link = get_link_rel_next
2629
2630
    @classmethod
2631
    def get_comic_info(cls, soup, link):
2632
        """Get information about a particular comics."""
2633
        imgs = soup.find('div', id='comic').find_all('img')
2634
        assert all(i['alt'] == i['title'] for i in imgs)
2635
        assert len(imgs) == 1