From 736d9aa8cf0af49c4095625a1e00de9fd4dd2af4 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 7 Mar 2013 18:22:39 +0100 Subject: [PATCH] Code cleanup. --- dosagelib/scraper.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/dosagelib/scraper.py b/dosagelib/scraper.py index 3d924ea37..9b0809ac9 100644 --- a/dosagelib/scraper.py +++ b/dosagelib/scraper.py @@ -9,25 +9,15 @@ from .output import out class _BasicScraper(object): - '''Base class with scrape functions for comics. + '''Base class with scrape functions for comics.''' - @type url: C{string} - @cvar url: The URL for the comic strip. - @type stripUrl: C{string} - @cvar stripUrl: A string that is interpolated with the strip index - to yield the URL for a particular strip. - @type firstStripUrl: C{string} optional - @cvar firstStripUrl: Stop searching for previous URLs at this URL. - If not set and no previous URL is found a warning is printed. - @type imageSearch: C{regex} - @cvar imageSearch: A compiled regex that will locate the strip image URL - when applied to the strip page. - @type prevSearch: C{regex} - @cvar prevSearch: A compiled regex that will locate the URL for the - previous strip when applied to a strip page. - ''' + # The URL for the comic strip + url = None - # stop at this URL + # A string that is interpolated with the strip index to yield the URL for a particular strip. + stripUrl = None + + # Stop search for previous URLs at this URL firstStripUrl = None # if more than one image per URL is expected @@ -42,6 +32,12 @@ class _BasicScraper(object): # a description of the comic contents description = '' + # compiled regular expression that will locate the URL for the previous strip in a page + prevSearch = None + + # compiled regular expression that will locate the strip image URLs strip in a page + imageSearch = None + # usually the index format help help = ''