Code Duplication    Length = 17-18 lines in 2 locations

comics.py 2 locations

@@ 1778-1795 (lines=18) @@
1775
1776
1777
class BigFootJustice(GenericNavigableComic):
1778
    """Class to retrieve Big Foot Justice comics."""
1779
    # Also on http://tapastic.com/series/bigfoot-justice
1780
    name = 'bigfoot'
1781
    long_name = 'Big Foot Justice'
1782
    url = 'http://bigfootjustice.com'
1783
    get_first_comic_link = get_a_navi_navifirst
1784
    get_navi_link = get_a_navi_comicnavnext_navinext
1785
1786
    @classmethod
1787
    def get_comic_info(cls, soup, link):
1788
        """Get information about a particular comics."""
1789
        imgs = soup.find('div', id='comic').find_all('img')
1790
        assert all(i['title'] == i['alt'] for i in imgs)
1791
        title = ' '.join(i['title'] for i in imgs)
1792
        return {
1793
            'img': [i['src'] for i in imgs],
1794
            'title': title,
1795
        }
1796
1797
1798
class RespawnComic(GenericNavigableComic):
@@ 2707-2723 (lines=17) @@
2704
2705
2706
class PlanC(GenericNavigableComic):
2707
    """Class to retrieve Plan C comics."""
2708
    name = 'planc'
2709
    long_name = 'Plan C'
2710
    url = 'http://www.plancomic.com'
2711
    get_first_comic_link = get_a_navi_navifirst
2712
    get_navi_link = get_a_navi_comicnavnext_navinext
2713
2714
    @classmethod
2715
    def get_comic_info(cls, soup, link):
2716
        """Get information about a particular comics."""
2717
        title = soup.find('h2', class_='post-title').string
2718
        date_str = soup.find("span", class_="post-date").string
2719
        day = string_to_date(date_str, "%B %d, %Y")
2720
        imgs = soup.find('div', id='comic').find_all('img')
2721
        return {
2722
            'title': title,
2723
            'img': [i['src'] for i in imgs],
2724
            'month': day.month,
2725
            'year': day.year,
2726
            'day': day.day,