Code Duplication    Length = 21-23 lines in 2 locations

comics.py 2 locations

@@ 645-667 (lines=23) @@
642
643
class PenelopeBagieu(GenericNavigableComic):
644
    """Class to retrieve comics from Penelope Bagieu's blog."""
645
    name = 'bagieu'
646
    long_name = 'Ma vie est tout a fait fascinante (Bagieu)'
647
    url = 'http://www.penelope-jolicoeur.com'
648
    _categories = ('FRANCAIS', )
649
    get_navi_link = get_link_rel_next
650
    get_first_comic_link = simulate_first_link
651
    first_url = 'http://www.penelope-jolicoeur.com/2007/02/ma-vie-mon-oeuv.html'
652
653
    @classmethod
654
    def get_comic_info(cls, soup, link):
655
        """Get information about a particular comics."""
656
        date_str = soup.find('h2', class_='date-header').string
657
        day = string_to_date(date_str, "%A %d %B %Y", "fr_FR.utf8")
658
        imgs = soup.find('div', class_='entry-body').find_all('img')
659
        title = soup.find('h3', class_='entry-header').string
660
        return {
661
            'title': title,
662
            'img': [i['src'] for i in imgs],
663
            'month': day.month,
664
            'year': day.year,
665
            'day': day.day,
666
        }
667
668
669
class OneOneOneOneComic(GenericNavigableComic):
670
    """Class to retrieve 1111 Comics."""
@@ 1650-1670 (lines=21) @@
1647
    long_name = 'Infinite Monkey Business'
1648
    url = 'http://infinitemonkeybusiness.net'
1649
    get_navi_link = get_a_navi_comicnavnext_navinext
1650
    get_first_comic_link = simulate_first_link
1651
    first_url = 'http://infinitemonkeybusiness.net/comic/pillory/'
1652
1653
    @classmethod
1654
    def get_comic_info(cls, soup, link):
1655
        """Get information about a particular comics."""
1656
        title = soup.find('meta', property='og:title')['content']
1657
        imgs = soup.find('div', id='comic').find_all('img')
1658
        return {
1659
            'title': title,
1660
            'img': [i['src'] for i in imgs],
1661
        }
1662
1663
1664
class Wondermark(GenericListableComic):
1665
    """Class to retrieve the Wondermark comics."""
1666
    name = 'wondermark'
1667
    long_name = 'Wondermark'
1668
    url = 'http://wondermark.com'
1669
    get_url_from_archive_element = get_href
1670
1671
    @classmethod
1672
    def get_archive_elements(cls):
1673
        archive_url = urljoin_wrapper(cls.url, 'archive/')