http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10306
Revision: 10306 Author: xqt Date: 2012-06-07 09:22:57 +0000 (Thu, 07 Jun 2012) Log Message: ----------- ip_regexp matchs ip6, update from rewrite r10303
Modified Paths: -------------- trunk/pywikipedia/userlib.py
Modified: trunk/pywikipedia/userlib.py =================================================================== --- trunk/pywikipedia/userlib.py 2012-06-07 09:19:05 UTC (rev 10305) +++ trunk/pywikipedia/userlib.py 2012-06-07 09:22:57 UTC (rev 10306) @@ -35,9 +35,15 @@ """The mediawiki API does not allow IP lookups.""" pass
-ip_regexp = re.compile(r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}' \ - r'(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$') +ip_regexp = re.compile(r'^(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}' + r'(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|' + r'(((?=(?=(.*?(::)))\3(?!.+\4)))\4?|[\dA-F]{1,4}:)' + r'([\dA-F]{1,4}(\4|:\b)|\2){5}' + r'(([\dA-F]{1,4}(\4|:\b|$)|\2){2}|' + r'(((2[0-4]|1\d|[1-9])?\d|25[0-5]).?\b){4}))\Z', + re.IGNORECASE)
+ class User(object): """A class that represents a Wiki user. """