@@ 2300-2319 (lines=20) @@ | ||
2297 | def get_comic_info(cls, soup, tr): |
|
2298 | """Get information about a particular comics.""" |
|
2299 | td_num, td_comic, td_date, _ = tr.find_all('td') |
|
2300 | num = int(td_num.string) |
|
2301 | link = td_comic.find('a') |
|
2302 | title = link.string |
|
2303 | imgs = soup.find_all('img', id='comic_image') |
|
2304 | date_str = td_date.string |
|
2305 | day = string_to_date(remove_st_nd_rd_th_from_date(date_str), "%B %d, %Y, %I:%M %p") |
|
2306 | assert len(imgs) == 1 |
|
2307 | assert all(i.get('alt') == i.get('title') for i in imgs) |
|
2308 | return { |
|
2309 | 'num': num, |
|
2310 | 'title': title, |
|
2311 | 'alt': imgs[0].get('alt', ''), |
|
2312 | 'img': [i['src'] for i in imgs], |
|
2313 | 'month': day.month, |
|
2314 | 'year': day.year, |
|
2315 | 'day': day.day, |
|
2316 | } |
|
2317 | ||
2318 | ||
2319 | class LonnieMillsap(GenericNavigableComic): |
|
2320 | """Class to retrieve Lonnie Millsap's comics.""" |
|
2321 | name = 'millsap' |
|
2322 | long_name = 'Lonnie Millsap' |
|
@@ 1968-1986 (lines=19) @@ | ||
1965 | def get_comic_info(cls, soup, td): |
|
1966 | """Get information about a particular comics.""" |
|
1967 | url = cls.get_url_from_archive_element(td) |
|
1968 | title = td.find('a').string |
|
1969 | month_and_day = td.previous_sibling.string |
|
1970 | link_re = re.compile('^%s/([0-9]+)/' % cls.url) |
|
1971 | year = link_re.match(url).groups()[0] |
|
1972 | date_str = month_and_day + ' ' + year |
|
1973 | day = string_to_date(date_str, '%b %d %Y') |
|
1974 | imgs = [soup.find('div', id='comic').find('img')] |
|
1975 | assert len(imgs) == 1 |
|
1976 | assert all(i['title'] == i['alt'] == title for i in imgs) |
|
1977 | return { |
|
1978 | 'month': day.month, |
|
1979 | 'year': day.year, |
|
1980 | 'day': day.day, |
|
1981 | 'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs], |
|
1982 | 'title': title, |
|
1983 | } |
|
1984 | ||
1985 | ||
1986 | class DiscoBleach(GenericEmptyComic): # Does not work anymore |
|
1987 | """Class to retrieve Disco Bleach Comics.""" |
|
1988 | name = 'discobleach' |
|
1989 | long_name = 'Disco Bleach' |