http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9689
Revision: 9689
Author: xqt
Date: 2011-10-30 13:55:07 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
replace deprecated Page.WithoutNamespace() with Page.title(withNamespace=False)
Modified Paths:
--------------
trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py
===================================================================
--- trunk/pywikipedia/pagegenerators.py 2011-10-30 13:09:16 UTC (rev 9688)
+++ trunk/pywikipedia/pagegenerators.py 2011-10-30 13:55:07 UTC (rev 9689)
@@ -428,7 +428,7 @@
firstPageTitle = firstPage.title()
namespace = pywikibot.Page(site, firstPageTitle).namespace()
firstPageTitle = pywikibot.Page(site,
- firstPageTitle).titleWithoutNamespace()
+ firstPageTitle).title(withNamespace=False)
gen = AllpagesPageGenerator(firstPageTitle, namespace,
includeredirects=False)
elif arg.startswith('-start'):
@@ -445,7 +445,7 @@
namespace = pywikibot.Page(site, firstPageTitle).namespace()
firstPageTitle = pywikibot.Page(site,
- firstPageTitle).titleWithoutNamespace()
+ firstPageTitle).title(withNamespace=False)
gen = AllpagesPageGenerator(firstPageTitle, namespace,
includeredirects=False)
elif arg.startswith('-redirectonly'):
@@ -455,7 +455,7 @@
u'At which page do you want to start?')
namespace = pywikibot.Page(site, firstPageTitle).namespace()
firstPageTitle = pywikibot.Page(site,
- firstPageTitle).titleWithoutNamespace()
+ firstPageTitle).title(withNamespace=False)
gen = AllpagesPageGenerator(firstPageTitle, namespace,
includeredirects='only')
elif arg.startswith('-prefixindex'):
@@ -546,7 +546,7 @@
prefixpage = pywikibot.Page(site, prefix)
if namespace is None:
namespace = prefixpage.namespace()
- title = prefixpage.titleWithoutNamespace()
+ title = prefixpage.title(withNamespace=False)
for page in site.prefixindex(prefix=title, namespace=namespace,
includeredirects=includeredirects):
yield page
@@ -1111,10 +1111,7 @@
for page in generator:
# get the page title
- if ignore_namespace:
- title = page.titleWithoutNamespace()
- else:
- title = page.title()
+ title = page.title(withNamespace = not ignore_namespace)
if inverse:
# yield page if NOT matched by all regex