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 Plan C comics."""
2705
    name = 'planc'
2706
    long_name = 'Plan C'
2707
    url = 'http://www.plancomic.com'
2708
    get_first_comic_link = get_a_navi_navifirst
2709
    get_navi_link = get_a_navi_comicnavnext_navinext
2710
2711
    @classmethod
2712
    def get_comic_info(cls, soup, link):
2713
        """Get information about a particular comics."""
2714
        title = soup.find('h2', class_='post-title').string
2715
        date_str = soup.find("span", class_="post-date").string
2716
        day = string_to_date(date_str, "%B %d, %Y")
2717
        imgs = soup.find('div', id='comic').find_all('img')
2718
        return {
2719
            'title': title,
2720
            'img': [i['src'] for i in imgs],
2721
            'month': day.month,
2722
            'year': day.year,
2723
            'day': day.day,
2724
        }
2725
2726