Logo Search packages:      
Sourcecode: webcheck version File versions

def crawler::Link::__tolink (   self,
  link 
) [private]

Convert the link to a link object, either it is already a link,
a link object is returned from the database or a new link is
created. This returns None for empty strings.

Definition at line 434 of file crawler.py.

00434                             :
        """Convert the link to a link object, either it is already a link,
        a link object is returned from the database or a new link is
        created. This returns None for empty strings."""
        # ignore if child is empty string
        if link == '' or link == u'':
            return None
        if type(link) is unicode and self.encoding:
            # convert url to binary if passed as unicode
            link = link.encode(self.encoding)
        # convert the url to a link object if we were called with a url
        if type(link) is unicode or type(link) is str:
            link = self.site.get_link(self.__checkurl(link))
        # re're done
        return link

    def add_child(self, child):


Generated by  Doxygen 1.6.0   Back to index