Code Duplication    Length = 19-20 lines in 2 locations

comics.py 2 locations

@@ 2378-2397 (lines=20) @@
2375
        return urljoin_wrapper(cls.url, link['href'])
2376
2377
    @classmethod
2378
    def get_comic_info(cls, soup, tr):
2379
        """Get information about a particular comics."""
2380
        td_num, td_comic, td_date, _ = tr.find_all('td')
2381
        num = int(td_num.string)
2382
        link = td_comic.find('a')
2383
        title = link.string
2384
        imgs = soup.find_all('img', id='comic_image')
2385
        date_str = td_date.string
2386
        day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y, %I:%M %p")
2387
        assert len(imgs) == 1
2388
        assert all(i.get('alt') == i.get('title') for i in imgs)
2389
        return {
2390
            'num': num,
2391
            'title': title,
2392
            'alt': imgs[0].get('alt', ''),
2393
            'img': [i['src'] for i in imgs],
2394
            'month': day.month,
2395
            'year': day.year,
2396
            'day': day.day,
2397
        }
2398
2399
2400
class LonnieMillsap(GenericNavigableComic):
@@ 1994-2012 (lines=19) @@
1991
        return td.find('a')['href']
1992
1993
    @classmethod
1994
    def get_comic_info(cls, soup, td):
1995
        """Get information about a particular comics."""
1996
        url = cls.get_url_from_archive_element(td)
1997
        title = td.find('a').string
1998
        month_and_day = td.previous_sibling.string
1999
        link_re = re.compile('^%s/([0-9]+)/' % cls.url)
2000
        year = link_re.match(url).groups()[0]
2001
        date_str = month_and_day + ' ' + year
2002
        day = string_to_date(date_str, '%b %d %Y')
2003
        imgs = [soup.find('div', id='comic').find('img')]
2004
        assert len(imgs) == 1
2005
        assert all(i['title'] == i['alt'] == title for i in imgs)
2006
        return {
2007
            'month': day.month,
2008
            'year': day.year,
2009
            'day': day.day,
2010
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
2011
            'title': title,
2012
        }
2013
2014
2015
class DiscoBleach(GenericDeletedComic):