Revision: 6679 Author: nicdumz Date: 2009-04-23 05:21:30 +0000 (Thu, 23 Apr 2009)
Log Message: ----------- Allow fromPage to define a source parameter too
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2009-04-23 05:18:08 UTC (rev 6678) +++ branches/rewrite/pywikibot/page.py 2009-04-23 05:21:30 UTC (rev 6679) @@ -1950,8 +1950,11 @@ return hash(self.astext())
@staticmethod - def fromPage(page): - """Create a Link from a Page object""" + def fromPage(page, source=None): + """ + Create a Link to a Page. + @param source: Link from site source + """
link = Link.__new__(Link) link._site = page.site() @@ -1961,6 +1964,7 @@ allowInterwiki=False, withSection=False) link._anchor = None + link._source = source or pywikibot.Site()
return link
pywikipedia-svn@lists.wikimedia.org