Revision: 7612
Author: xqt
Date: 2009-11-09 12:22:38 +0000 (Mon, 09 Nov 2009)
Log Message:
-----------
Bugfix for InvalidTitle Error (#2893194)
Modified Paths:
--------------
trunk/pywikipedia/fixing_redirects.py
Modified: trunk/pywikipedia/fixing_redirects.py
===================================================================
--- trunk/pywikipedia/fixing_redirects.py 2009-11-09 09:16:50 UTC (rev 7611)
+++ trunk/pywikipedia/fixing_redirects.py 2009-11-09 12:22:38 UTC (rev 7612)
@@ -83,7 +83,7 @@
# Make sure that next time around we will not find this same hit.
curpos = m.start() + 1
# ignore interwiki links and links to sections of the same page
- if m.group('title') == '' or mysite.isInterwikiLink(m.group('title')):
+ if m.group('title').strip() == '' or mysite.isInterwikiLink(m.group('title')):
continue
else:
actualLinkPage = wikipedia.Page(targetPage.site(), m.group('title'))
@@ -157,7 +157,7 @@
try:
page.put(text, comment)
except (wikipedia.Error):
- wikipedia.output('Error : unable to put %s' % page.aslink())
+ wikipedia.output('Error: unable to put %s' % page.aslink())
def main():
start = '!'
Revision: 7609
Author: alexsh
Date: 2009-11-09 09:08:43 +0000 (Mon, 09 Nov 2009)
Log Message:
-----------
family.py: add centralauth identify default data
Modified Paths:
--------------
trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2009-11-08 18:45:59 UTC (rev 7608)
+++ trunk/pywikipedia/family.py 2009-11-09 09:08:43 UTC (rev 7609)
@@ -3085,6 +3085,11 @@
self.disambiguationTemplates = {
'_default': []
}
+ # A list with the projects could share cross-project sessions.
+ self.cross_projects = []
+ # A list with the name for cross-project cookies.
+ # default for wikimedia centralAuth extensions.
+ self.cross_projects_cookies = ['centralauth_Session', 'centralauth_Token', 'centralauth_User']
# A list with the name in the cross-language flag permissions
self.cross_allowed = []
# A list with the name of the category containing disambiguation
Revision: 7604
Author: alexsh
Date: 2009-11-06 22:33:16 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
* Page()._getEditPage(): add sysop cookies handle. (I forgot to add it)
* site()._load(): add force login when detect the data is anonymous info.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2009-11-06 12:41:06 UTC (rev 7603)
+++ trunk/pywikipedia/wikipedia.py 2009-11-06 22:33:16 UTC (rev 7604)
@@ -749,7 +749,7 @@
retry_idle_time = 1
while not textareaFound:
- data = query.GetData(params, self.site())
+ data = query.GetData(params, self.site(), sysop=sysop)
if 'error' in data:
raise RuntimeError("API query error: %s" % data)
pageInfo = data['query']['pages'].values()[0]
@@ -5547,6 +5547,7 @@
index = self._userIndex(sysop)
# Check for blocks
+
if 'blockedby' in text and not self._isBlocked[index]:
# Write a warning if not shown earlier
if sysop:
@@ -5931,10 +5932,21 @@
text = query.GetData(params, self, sysop=sysop)['userinfo']
else:
text = query.GetData(params, self, sysop=sysop)['query']['userinfo']
+
+ if 'anon' in text:
+ if verbose: output(u'Force login cause you\'re in anonymous mode.')
+ self.forceLogin(sysop)
+ return self._load(sysop, force)
+
self._getUserData(text, sysop = sysop, force = force)
else:
url = self.edit_address('Non-existing_page')
text = self.getUrl(url, sysop = sysop)
+ if " value=\"+\\\" " in text: #anonymous mode text
+ if verbose: output(u'Force login cause you\'re in anonymous mode.')
+ self.forceLogin(sysop)
+ return self._load(sysop, force)
+
self._getUserDataOld(text, sysop = sysop, force = force)