Added ImageLinkExtractor's missing docstring

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40593
This commit is contained in:
elpolilla 2009-01-02 02:25:17 +00:00
parent 5757e54a28
commit c82c799d07
1 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,15 @@ class RegexLinkExtractor(LinkExtractor):
return any(allowed) and not any(denied)
class ImageLinkExtractor(object):
'''ImageLinkExtractor objects are intended to extract image links from HTML pages
given certain xpath locations.
These locations can be passed in a list/tuple either when instanciating the LinkExtractor,
or whenever you call extract_links.
If no locations are specified in any of these places, a default pattern '//img' will be used.
If locations are specified when instanciating the LinkExtractor, and also when calling extract_links,
both locations will be used for that call of extract_links'''
def __init__(self, locations=None):
self.locations = tuple(locations) if hasattr(locations, '__iter__') else tuple()