Utilisateur:Ir4ubot/Journaux/2008082800

python replace.py -fix:'borderedflag' -namespace:10 -file:"zzz.sav.txt"

help = """
                       * HTML       -  Convert HTML tags to wiki syntax, and
                                       fix XHTML.
                       * syntax     -  Try to fix bad wiki markup. Do not run
                                       this in automatic mode, as the bot may
                                       make mistakes.
                       * syntax-safe - Like syntax, but less risky, so you can
                                       run this in automatic mode.
                       * case-de - fix upper/lower case errors in German
                       * grammar-de - fix grammar and typography in German
"""

fixes = {
    # These replacements will convert HTML to wiki syntax where possible, and
    # make remaining tags XHTML compliant.
    'borderedflag': {
        'regex': True,
        # We don't want to mess up pages which discuss HTML tags, so we skip
        # all pages which contain nowiki tags.
        'exceptions':  ['<nowiki>'],
        'msg': {
               
               'fr':u'Robot: convertit les drapeaux bordered par des drapeaux CIO-d',
              
              },
        'replacements': [

	    (r'\[\[Image:Flag of Japan \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Japon|)\s?\]]', r"{{JPN-d|\1}}"),
	    (r'\[\[Image:Flag of France \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|France|)?\]]', r"{{FRA-d|\1}}"),
            (r'\[\[Image:Flag of Afghanistan \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Afghanistan|)?\]]', r"{{AFG-d|\1}}"),
	    (r'\[\[Image:Flag of Algeria \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Algérie|)\s?\]]', r"{{ALG-d|\1}}"),
	    (r'\[\[Image:Flag of Bahrain \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Bahreïn|)\s?\]]', r"{{BRN-d|\1}}"),
	    (r'\[\[Image:Flag of Bulgaria \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Bulgarie|)\s?\]]', r"{{BUL-d|\1}}"),
	    (r'\[\[Image:Flag of Chile \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Chili|)\s?\]]', r"{{CHI-d|\1}}"),
	    (r'\[\[Image:Flag of Cyprus \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Chypre|)\s?\]]', r"{{CYP-d|\1}}"),
	    (r'\[\[Image:Flag of Estonia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Estonie|)\s?\]]', r"{{EST-d|\1}}"),
	    (r'\[\[Image:Flag of Finland \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Finlande|)\s?\]]', r"{{FIN-d|\1}}"),
	    (r'\[\[Image:Flag of Georgia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Géorgie|)\s?\]]', r"{{GEO-d|\1}}"),
            (r'\[\[Image:Flag of Indonesia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Indonésia|)\s?\]]', r"{{INA-d|\1}}"),
	    (r'\[\[Image:Flag of Madagascar \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Madagascar|)\s?\]]', r"{{MAD-d|\1}}"),
	    (r'\[\[Image:Flag of Malta \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Malte|)\s?\]]', r"{{MLT-d|\1}}"),
	    (r'\[\[Image:Flag of Mexico \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Mexique|)\s?\]]', r"{{MEX-d|\1}}"),
	    (r'\[\[Image:Flag of Monaco \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Monaco|)\s?\]]', r"{{MON-d|\1}}"),
            (r'\[\[Image:Flag of Pakistan \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Pakistan|)\s?\]]', r"{{PAK-d|\1}}"),
	    (r'\[\[Image:Flag of Poland \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Pologne|)\s?\]]', r"{{POL-d|\1}}"),
	    (r'\[\[Image:Flag of Poland \(bordered\ 2\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Pologne|)\s?\]]', r"{{POL-d|\1}}"),
	    (r'\[\[Image:Flag of Qatar \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Qatar|)\s?\]]', r"{{QAT-d|\1}}"),
	    (r'\[\[Image:Flag of Russia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Russie|)\s??\]]', r"{{RUS-d|\1}}"),
	    (r'\[\[Image:Flag of Singapore \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Singapour|)\s?\]]', r"{{SIN-d|\1}}"),
	    (r'\[\[Image:Flag of Slovakia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Slovaquie|)\s?\]]', r"{{SVK-d|\1}}"),
            (r'\[\[Image:Flag of Slovenia \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Slovénie|)\s?\]]', r"{{SLO-d|\1}}"),
	    (r'\[\[Image:Flag of South Korea \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|Corée du Sud|)\s?\]]', r"{{KOR-d|\1}}"),
	    (r'\[\[Image:Flag of the Czech \(bordered\).svg\|\s?([0-9]{2}\s?px)\|\s?([.*]|République tchèque|)\s?\]]', r"{{CZE-d|\1}}"),
	    #(r'\[\[Image:Flag of the Faroe Islands \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{AHO-d|\1}}"),
	    #(r'\[\[Image:Flag of Jersey \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{ALG-d|\1}}"),
	     #(r'\[\[Image:Flag of Guernsey \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{FRA-d|\1}}"),
	    #(r'\[\[Image:Flag of Wales \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{BUL-d|\1}}"),
	    #(r'\[\[Image:Flag of the Czech \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{CZE-d|\1}}"),
	    #(r'\[\[Image:Flag of the Faroe Islands \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{AHO-d|\1}}"),
            #(r'\[\[Image:Flag of the Netherlands Antilles \(bordered\).svg\|\s?([0-9]{2}\s?px)\s?[.*]?\]]', r"{{AHO-d|\1}}"),
            # TODO: maybe we can make the bot replace <p> tags with \r\n's.
        ]
    },
   
}