http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8982
Revision: 8982
Author: xqt
Date: 2011-02-18 17:32:25 +0000 (Fri, 18 Feb 2011)
Log Message:
-----------
Fix documentation for usage of -transcludes (update from trunk r8981)
Modified Paths:
--------------
branches/rewrite/pywikibot/pagegenerators.py
Modified: branches/rewrite/pywikibot/pagegenerators.py
===================================================================
--- branches/rewrite/pywikibot/pagegenerators.py 2011-02-18 17:31:15 UTC (rev 8981)
+++ branches/rewrite/pywikibot/pagegenerators.py 2011-02-18 17:32:25 UTC (rev 8982)
@@ -120,7 +120,7 @@
-titleregex Work on titles that match the given regular expression.
-transcludes Work on all pages that use a certain template.
- Argument can also be given as "-transcludes:Template:Title".
+ Argument can also be given as "-transcludes:Title".
-unusedfiles Work on all description pages of images/media files that are
not used anywhere.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8981
Revision: 8981
Author: xqt
Date: 2011-02-18 17:31:15 +0000 (Fri, 18 Feb 2011)
Log Message:
-----------
Fix documentation for usage of -transcludes
Modified Paths:
--------------
trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py
===================================================================
--- trunk/pywikipedia/pagegenerators.py 2011-02-17 23:45:06 UTC (rev 8980)
+++ trunk/pywikipedia/pagegenerators.py 2011-02-18 17:31:15 UTC (rev 8981)
@@ -120,7 +120,7 @@
-titleregex Work on titles that match the given regular expression.
-transcludes Work on all pages that use a certain template.
- Argument can also be given as "-transcludes:Template:Title".
+ Argument can also be given as "-transcludes:Title".
-unusedfiles Work on all description pages of images/media files that are
not used anywhere.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8980
Revision: 8980
Author: valhallasw
Date: 2011-02-17 23:45:06 +0000 (Thu, 17 Feb 2011)
Log Message:
-----------
Follow-up for r8979: check for None values in username/_userinfo (PYWP-16)
If no (sysop/user) username is defined, self.username[False/True] will be None. This will trigger an Exception in the constructor for the Page (and following
Link) objects. This is now fixed.
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2011-02-17 21:58:21 UTC (rev 8979)
+++ branches/rewrite/pywikibot/site.py 2011-02-17 23:45:06 UTC (rev 8980)
@@ -678,7 +678,9 @@
@param sysop: if True, require sysop privileges.
"""
- if pywikibot.Page(self, ns=2, title=self.userinfo['name']) != \
+ if self.userinfo['name'] is None or\
+ self._username[sysop] is None or\
+ pywikibot.Page(self, ns=2, title=self.userinfo['name']) != \
pywikibot.Page(self, ns=2, title=self._username[sysop]):
return False
return (not sysop) or 'sysop' in self.userinfo['groups']
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8979
Revision: 8979
Author: valhallasw
Date: 2011-02-17 21:58:21 +0000 (Thu, 17 Feb 2011)
Log Message:
-----------
Use Page objects to check for user name equality (PYWP-15)
The Site object checks whether the is logged in by checking equality of user
names. When the first-letter capitalization is not equal, this caused the bot
to relogin. The check now uses Page objects, so site-specific capitalization
conventions are used.
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2011-02-17 21:05:08 UTC (rev 8978)
+++ branches/rewrite/pywikibot/site.py 2011-02-17 21:58:21 UTC (rev 8979)
@@ -678,7 +678,8 @@
@param sysop: if True, require sysop privileges.
"""
- if self.userinfo['name'] != self._username[sysop]:
+ if pywikibot.Page(self, ns=2, title=self.userinfo['name']) != \
+ pywikibot.Page(self, ns=2, title=self._username[sysop]):
return False
return (not sysop) or 'sysop' in self.userinfo['groups']
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8978
Revision: 8978
Author: valhallasw
Date: 2011-02-17 21:05:08 +0000 (Thu, 17 Feb 2011)
Log Message:
-----------
Added manual check for ctrl-C in getpass input. Fixes PYWP-13.
A bug in the getpass library makes it not respond to command characters such as
ctrl-Z and ctrl-C in python 2.6+. This adds a manual check for ctrl-C characters
in the password and raises an Exception if found.
See also: http://bugs.python.org/issue11236
Modified Paths:
--------------
branches/rewrite/pywikibot/userinterfaces/terminal_interface.py
Modified: branches/rewrite/pywikibot/userinterfaces/terminal_interface.py
===================================================================
--- branches/rewrite/pywikibot/userinterfaces/terminal_interface.py 2011-02-17 20:27:53 UTC (rev 8977)
+++ branches/rewrite/pywikibot/userinterfaces/terminal_interface.py 2011-02-17 21:05:08 UTC (rev 8978)
@@ -175,6 +175,11 @@
if password:
import getpass
text = getpass.getpass('')
+ # See PYWP-13 / http://bugs.python.org/issue11236
+ # getpass does not always raise an KeyboardInterrupt when ^C
+ # is pressed.
+ if '\x03' in text:
+ raise KeyboardInterrupt()
else:
text = raw_input()
finally: