Code Duplication    Length = 16-17 lines in 2 locations

comics.py 2 locations

@@ 4940-4956 (lines=17) @@
4937
4938
class SinewynTumblr(GenericTumblrV1):
4939
    """Class to retrieve Sinewyn comics."""
4940
    # Also on https://sinewyn.wordpress.com
4941
    name = 'sinewyn-tumblr'
4942
    long_name = 'Sinewyn (from Tumblr)'
4943
    url = 'https://sinewyn.tumblr.com'
4944
4945
4946
class ItFoolsAMonster(GenericTumblrV1):
4947
    """Class to retrieve It Fools A Monster comics."""
4948
    name = 'itfoolsamonster'
4949
    long_name = 'It Fools A Monster'
4950
    url = 'http://itfoolsamonster.com'
4951
4952
4953
class BoumeriesTumblr(GenericTumblrV1):
4954
    """Class to retrieve Boumeries comics."""
4955
    # Also on http://bd.boumerie.com
4956
    # Also on http://comics.boumerie.com
4957
    name = 'boumeries-tumblr'
4958
    long_name = 'Boumeries (from Tumblr)'
4959
    url = 'http://boumeries.tumblr.com/'
@@ 782-797 (lines=16) @@
779
    get_navi_link = get_link_rel_next
780
    get_url_from_link = join_cls_url_to_href
781
782
    @classmethod
783
    def get_comic_info(cls, soup, link):
784
        """Get information about a particular comics."""
785
        short_url_re = re.compile('^%s/\\?p=([0-9]*)' % cls.url)
786
        short_url = cls.get_url_from_link(soup.find('link', rel='shortlink'))
787
        num = int(short_url_re.match(short_url).groups()[0])
788
        imgs = soup.find('div', id='comic').find_all('img')
789
        assert len(imgs) == 1, imgs
790
        title = imgs[0]['alt']
791
        title2 = imgs[0]['title']
792
        return {
793
            'short_url': short_url,
794
            'title': title,
795
            'title2': title2,
796
            'img': [urljoin_wrapper(cls.url, i['src']) for i in imgs],
797
            'num': num,
798
        }
799
800