వికీపీడియా:వికీప్రాజెక్టు/ఆంధ్ర ప్రదేశ్ గ్రామాలు/సమాచారపెట్టె మెరుగు/వికీడేటా/Sample user-fixes.py


#
# fix PIN parameter errors in articles using Infobox Settlement/sandbox
# This fix is used with command:
# python replace.py -fix:fixpin -page: or -catr:
# example usage from PAWS terminal
# $ pwb.py replace -fix:fixpin -catr:ఆంధ్ర_ప్రదేశ్_గ్రామాలు

fixes['fixpin'] = {
  'regex': True,
  'msg': {
        '_default':u'Remove space in PIN if it exists after three digits',
  },
  'replacements' : [
       (r'postal_code = ([0-9]{3}) ([0-9]{3})', r'postal_code = \1\2'),
  ]
}
#
# Update long Infobox with one line Infobox for AP villages
# This fix is used with command:
# pwb.py replace -fix:infoboximp -file:<file name containing the articles which use old infobox . Can be got from petscan tool
# example usage from PAWS terminal
#pwb.py replace -regex -dotall -fix:infoboximp -file:prakasam_villages_ibi_ppwiki_25138.txt
fixes['infoboximp'] = {
  'regex': True,
  'msg': {
        '_default':u'Replace Very long and improperly used Infobox Settlement/sandbox with one line Infobox which uses wikidata'
  },
   'replacements': [
       (r'\{(\{Infobox Settlement/sandbox.+?)\}\}','{{Infobox India AP Village}}'),
   ]
}