Revision: 7503
Author:   xqt
Date:     2009-10-19 11:19:23 +0000 (Mon, 19 Oct 2009)

Log Message:
-----------
actualized from trunk

Modified Paths:
--------------
    branches/rewrite/scripts/cosmetic_changes.py

Modified: branches/rewrite/scripts/cosmetic_changes.py
===================================================================
--- branches/rewrite/scripts/cosmetic_changes.py        2009-10-19 11:13:32 UTC 
(rev 7502)
+++ branches/rewrite/scripts/cosmetic_changes.py        2009-10-19 11:19:23 UTC 
(rev 7503)
@@ -158,12 +158,6 @@
     'zh': u'; 細部更改',
 }
 
-deprecatedTemplates = {
-    'wikipedia': {
-        'pdc':[u'Schkiss'],
-    }
-}
-
 class CosmeticChangesToolkit:
     def __init__(self, site, debug = False, redirect = False, namespace = 
None):
         self.site = site
@@ -184,7 +178,6 @@
         text = self.cleanUpSectionHeaders(text)
         text = self.putSpacesInLists(text)
         text = self.translateAndCapitalizeNamespaces(text)
-        text = self.removeDeprecatedTemplates(text)
         text = self.resolveHtmlEntities(text)
         text = self.validXhtml(text)
         text = self.removeUselessSpaces(text)
@@ -426,14 +419,6 @@
             text = pywikibot.replaceExcept(text, 
r'(?m)^(?P<bullet>(\*+|#+):*)(?P<char>[^\s\*#:].+?)', '\g<bullet> \g<char>', 
['comment', 'math', 'nowiki', 'pre'])
         return text
 
-    def removeDeprecatedTemplates(self, text):
-        if self.site.family.name in deprecatedTemplates and self.site.lang in 
deprecatedTemplates[self.site.family.name]:
-            for template in 
deprecatedTemplates[self.site.family.name][self.site.lang]:
-                if not self.site.nocapitalize:
-                    template = '[' + template[0].upper() + template[0].lower() 
+ ']' + template[1:]
-                text = pywikibot.replaceExcept(text, r'\{\{([mM][sS][gG]:)?' + 
template + '(?P<parameters>\|[^}]+|)}}', '', ['comment', 'math', 'nowiki', 
'pre'])
-        return text
-
     #from fixes.py
     def fixSyntaxSave(self, text):
         exceptions = ['nowiki', 'comment', 'math', 'pre', 'source', 
'startspace']



_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to