import sys12from Filist import Filist34def main(name, filename, *argv):5# print the contents of the given file6ft = Filist(filename)7ft.sub_lines(r'<programlisting>plasTeXpython', r'<programlisting language="python">')8ft.sub_lines(r'plasTeXangle', r'<>')910# label the last chapters as appendices11#i, match = ft.search_lines('<chapter id="tools">')12#ft.sub_lines(r'<chapter', r'<appendix', start=i)13#ft.sub_lines(r'</chapter', r'</appendix', start=i+1)1415ft.sub_lines(r'<emphasis role="bold">[email protected]</emphasis>',16r'<phrase role="keep-together"><emphasis role="bold">[email protected]</emphasis></phrase>')1718print ft1920if __name__ == '__main__':21main(*sys.argv)222324