1 from optparse import OptionParser
3 parser = OptionParser()
4 parser.add_option("-f", "--file", dest="filename",
5 help="open FILE", metavar="FILE", default=False)
6 parser.add_option("-b", "--whiteblack", dest='b', default=False, action='store_true')
8 (options, args) = parser.parse_args()
10 with open(options.filename, 'r') as f :
13 def correct_police(content) :
14 return content.replace('Arial Black','Arial')
16 content = correct_police(content)
18 def inverse_b_nb(content) :
19 return content.replace('#000000','#NOIRNOIRNOIR').replace('#ffffff','#000000').replace('#NOIRNOIRNOIR','#ffffff')
22 content = inverse_b_nb(content)
25 with open(options.filename, 'w') as f :