Good question, I have two ideas to fix it.
1.Leave current object page name in old page name.
Problem:no contents if not leaveRedirect.
-> delete current _content and make some handle to ignore.
2.Move current object page name to new title.
use self.__init__(self.site(), newtitle, defaultNamespace = self._namespace) to renew
object details, and re-get new self._contents.
Problem:Could other script know the page title is renamed?
anyone has other ideas?
--Alex S.H. Lin
※ 引述《"Marcin Cieslak" <saper(a)saper.info>》之郵件內容:
>tried simple:
>
>for t in pages:
> p = wikipedia.Page(site, t)
> p._moveOld("Wikipedysta:Joymaster/%s" % t, reason=action, sysop=True, leaveRedirect=False)
>
>
>Traceback (most recent call last):
> File "kalendariumwp.py", line 31, in <module>
> p._moveOld("Wikipedysta:Joymaster/%s" % t, reason=action, sysop=True, leaveRedirect=False)
> File "/home/admini/saper/wikipedia/pywikipedia/wikipedia.py", line 2772, in _moveOld
> self.get(force=True, get_redirect=True, throttle=False)
> File "/home/admini/saper/wikipedia/pywikipedia/wikipedia.py", line 684, in get
> self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle, sysop = sysop)
> File "/home/admini/saper/wikipedia/pywikipedia/wikipedia.py", line 758, in _getEditPage
> raise NoPage(self.site(), self.aslink(forceInterwiki = True),"Page does not exist. In rare cases, if you are certain the page does exist, look into overriding family.RversionTab" )
>wikipedia.NoPage: (wikipedia:pl, u'[[pl:Kalendarium Wojska Polskiego 1919]]', 'Page does not exist. In rare cases, if you are certain the page does exist, look into overriding family.RversionTab')
>
>There is obviously nothing to get, as nothing is left with the old name (not even a redirect).
>
>--
> << Marcin Cieslak // saper(a)saper.info >>
>
>
>_______________________________________________
>Pywikipedia-l mailing list
>Pywikipedia-l(a)lists.wikimedia.org
>https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>