Revision: 5270 Author: filnik Date: 2008-04-24 17:33:36 +0000 (Thu, 24 Apr 2008)
Log Message: ----------- Fixing italian regex, adding NicDumZ as coder that helps developing this script
Modified Paths: -------------- trunk/pywikipedia/blockpageschecker.py
Modified: trunk/pywikipedia/blockpageschecker.py =================================================================== --- trunk/pywikipedia/blockpageschecker.py 2008-04-24 15:19:15 UTC (rev 5269) +++ trunk/pywikipedia/blockpageschecker.py 2008-04-24 17:33:36 UTC (rev 5270) @@ -53,10 +53,11 @@ # # (C) Monobi a.k.a. Wikihermit, 2007 # (C) Filnik, 2007-2008 +# (C) NicDumZ, 2008 # # Distributed under the terms of the MIT license. # -__version__ = '$Id: blockpageschecker.py,v 1.1 2007/12/7 19.23.00 filnik Exp$' +__version__ = '$Id: blockpageschecker.py,v 1.5 2008/04/24 19.40.00 filnik Exp$' #
import re, webbrowser @@ -77,8 +78,8 @@ # Regex to get the semi-protection template templateSemiProtection = { 'en': None, - 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccoparziale(?:|[ _]scad|.*?||.*?)}}', - r'{{(?:[Tt]emplate:|)[Aa]bp(?:|[ _]scad|(?:.*?))}}'], + 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccoparziale(?:|[ _]scad|.*?||.*?)}}', + r'{{(?:[Tt]emplate:|)[Aa]bp(?:|[ _]scad|(?:.*?))}}'], 'fr': [ur'{{(?:[Tt]emplate:|[Mm]odèle:|)[Ss]emi[- ]?protection(|[^}]*)}}'], 'ja':[ur'{{(?:[Tt]emplate:|)半保護(?:[Ss]|)(?:|.+|)}}(\n+?|)'], 'zh':[ur'{{(?:[Tt]emplate:|)Protected|(?:[Ss]|[Ss]emi|半)(?:|.+|)}}(\n+?|)',ur'{{(?:[Tt]emplate:|)Mini-protected|(?:[Ss]|[Ss]emi|半)(?:|.+|)}}(\n+?|)',ur'{{(?:[Tt]emplate:|)Protected-logo|(?:[Ss]|[Ss]emi|半)(?:|.+|)}}(\n+?|)'], @@ -86,8 +87,8 @@ # Regex to get the total-protection template templateTotalProtection = { 'en': None, - 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisoblocco(?:|[ _]scad|(?:.*?)|minaccia|cancellata)}}', - r'{{(?:[Tt]emplate:|)(?:[Cc][Tt]|[Cc]anc fatte|[Cc][Ee].*?)}}', r'<div class="toccolours[ _]itwiki[ _]template[ _]avviso">(?:\s|\n)*?[Qq]uesta pagina'], + 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisoblocco(?:|[ _]scad|(?:.*?)|minaccia|cancellata)}}', + r'{{(?:[Tt]emplate:|)(?:[Cc][Tt]|[Cc]anc fatte|[Cc][Ee].*?)}}', r'<div class="toccolours[ _]itwiki[ _]template[ _]avviso">(?:\s|\n)*?[Qq]uesta pagina'], 'fr':[ur'{{(?:[Tt]emplate:|[Mm]odèle:|)[Pp]rotection(|[^}]*)}}', ur'{{(?:[Tt]emplate:|[Mm]odèle:|)(?:[Pp]age|[Aa]rchive|[Mm]odèle) protégée?(|[^}]*)}}'], 'ja':[ur'{{(?:[Tt]emplate:|)保護(?:[Ss]|)(?:|.+|)}}(\n+?|)'], @@ -96,14 +97,14 @@ # Regex to get the semi-protection move template templateSemiMoveProtection = { 'en': None, - 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], + 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], 'ja':[ur'{{(?:[Tt]emplate:|)移動半保護(?:[Ss]|)(?:|.+|)}}(\n+?|)'], 'zh':[r'{{(?:[Tt]emplate:|)Protected|(?:MS|ms)(?:|.+|)}}(\n+?|)',r'{{(?:[Tt]emplate:|)Mini-protected|(?:MS|ms)(?:|.+|)}}(\n+?|)',r'{{(?:[Tt]emplate:|)Protected-logo|(?:MS|ms)(?:|.+|)}}(\n+?|)'], } # Regex to get the total-protection move template templateTotalMoveProtection = { 'en': None, - 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], + 'it':[r'{{(?:[Tt]emplate:|)[Aa]vvisobloccospostamento(?:|[ _]scad|.*?||.*?)}}'], 'ja':[ur'{{(?:[Tt]emplate:|)移動保護(?:[Ss]|)(?:|.+|)}}(\n+?|)'], 'zh':[ur'{{(?:[Tt]emplate:|)Protected|(?:[Mm]|[Mm]ove|移[動动])(?:|.+|)}}(\n+?|)',ur'{{(?:[Tt]emplate:|)Mini-protected|(?:[Mm]|[Mm]ove|移[動动])(?:|.+|)}}(\n+?|)',ur'{{(?:[Tt]emplate:|)Protected-logo|(?:[Mm]|[Mm]ove|移[動动])(?:|.+|)}}(\n+?|)'], } @@ -169,7 +170,7 @@ """ Yield all the pages blocked, using Special:ProtectedPages """ # Avoid problems of encoding and stuff like that, let it divided please url = '/w/index.php?title=Special:ProtectedPages&type=edit&level=0' - if namespace != None: # /!\ if namespace seems simpler, but returns false when ns=0 + if namespace != None: # /!\ if namespace seems simpler, but returns false when ns=0
url += '&namespace=%s' % namespace site = wikipedia.getSite()