Logo Search packages:      
Sourcecode: uicilibris version File versions  Download package

def uicilibris::wikiParser::wikiParser::isUrl (   self,
  arg 
)
@return True if arg is a valid Url to a mediawiki.
As a side-effect, self.lines will be loaded with the
downloaded contents

Definition at line 324 of file wikiParser.py.

                        :
        """
        @return True if arg is a valid Url to a mediawiki.
        As a side-effect, self.lines will be loaded with the
        downloaded contents
        """
        if len(arg)<1:
            return False
        pattern=re.compile("http://(.+)/index.php/(.+)")
        m=pattern.match(arg[0])
        if m:
            self.baseAddress=m.group(1).decode("utf-8")
            self.host=re.findall("([^/]+).*", self.baseAddress)[0]
            basePage=m.group(2).decode("utf-8")
            text=self.getWikiContents(basePage)
            if text:
                wikiAddresses=re.findall("\[\[([^\]]+)\]\]", text)
                self.include_addresses(wikiAddresses, cbInfo=self.toStdErr)
                return True
        return False


Generated by  Doxygen 1.6.0   Back to index