Code Duplication    Length = 16-17 lines in 2 locations

comics.py 2 locations

@@ 1666-1682 (lines=17) @@
1663
    get_navi_link = get_link_rel_next
1664
1665
    @classmethod
1666
    def get_comic_info(cls, soup, link):
1667
        """Get information about a particular comics."""
1668
        title = soup.find('h2', class_='post-title').string
1669
        date_str = soup.find('span', class_='post-date').string
1670
        day = string_to_date(date_str, "%B %d, %Y")
1671
        imgs = soup.find('div', id='comic').find_all('img')
1672
        return {
1673
            'img': [i['src'] for i in imgs],
1674
            'title': title,
1675
            'day': day.day,
1676
            'month': day.month,
1677
            'year': day.year,
1678
        }
1679
1680
1681
class JustSayEh(GenericNavigableComic):
1682
    """Class to retrieve Just Say Eh comics."""
1683
    # Also on http//tapastic.com/series/Just-Say-Eh
1684
    name = 'justsayeh'
1685
    long_name = 'Just Say Eh'
@@ 2513-2528 (lines=16) @@
2510
    @classmethod
2511
    def get_comic_info(cls, soup, link):
2512
        """Get information about a particular comics."""
2513
        title = soup.find('h2', class_='post-title').string
2514
        author = soup.find("span", class_="post-author").find("a").string
2515
        date_str = soup.find("span", class_="post-date").string
2516
        day = string_to_date(date_str, "%B %d, %Y")
2517
        imgs = soup.find("div", id="comic").find_all("img")
2518
        assert all(i['alt'] == i['title'] for i in imgs)
2519
        assert len(imgs) <= 1
2520
        alt = imgs[0]['alt'] if imgs else ""
2521
        return {
2522
            'img': [i['src'] for i in imgs],
2523
            'title': title,
2524
            'alt': alt,
2525
            'author': author,
2526
            'day': day.day,
2527
            'month': day.month,
2528
            'year': day.year
2529
        }
2530
2531