Code Duplication    Length = 16-17 lines in 2 locations

comics.py 2 locations

@@ 4312-4328 (lines=17) @@
4309
    url = 'https://ubertool.tumblr.com'
4310
    _categories = ('UBERTOOL', )
4311
4312
4313
class LittleLifeLinesTumblr(GenericTumblrV1):
4314
    """Class to retrieve Little Life Lines comics."""
4315
    # Also on http://www.littlelifelines.com
4316
    name = 'life-tumblr'
4317
    long_name = 'Little Life Lines (from Tumblr)'
4318
    url = 'https://little-life-lines.tumblr.com'
4319
4320
4321
class TheyCanTalk(GenericTumblrV1):
4322
    """Class to retrieve They Can Talk comics."""
4323
    name = 'theycantalk'
4324
    long_name = 'They Can Talk'
4325
    url = 'http://theycantalk.com'
4326
4327
4328
class Will5NeverCome(GenericTumblrV1):
4329
    """Class to retrieve Will 5:00 Never Come comics."""
4330
    name = 'will5'
4331
    long_name = 'Will 5:00 Never Come ?'
@@ 730-745 (lines=16) @@
727
    name = 'nedroid'
728
    long_name = 'NeDroid'
729
    url = 'http://nedroid.com'
730
    get_first_comic_link = get_div_navfirst_a
731
    get_navi_link = get_link_rel_next
732
    get_url_from_link = join_cls_url_to_href
733
734
    @classmethod
735
    def get_comic_info(cls, soup, link):
736
        """Get information about a particular comics."""
737
        short_url_re = re.compile('^%s/\\?p=([0-9]*)' % cls.url)
738
        short_url = cls.get_url_from_link(soup.find('link', rel='shortlink'))
739
        num = int(short_url_re.match(short_url).groups()[0])
740
        imgs = soup.find('div', id='comic').find_all('img')
741
        assert len(imgs) == 1
742
        title = imgs[0]['alt']
743
        title2 = imgs[0]['title']
744
        return {
745
            'short_url': short_url,
746
            'title': title,
747
            'title2': title2,
748
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],