3 # html-accents.py -- convert (some) latin1 chars to html
4 # pod2html is so broken...
6 # source file of the GNU LilyPond music typesetter
8 # (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
15 sys
.path
.append ('@abs-step-bindir@')
16 sys
.path
.append (os
.environ
['HOME'] + '/usr/src/lilypond/stepmake/bin')
25 return name
+ ' version ' + version
;
28 sys
.stdout
.write (program_id () + '\n')
31 sys
.stdout
.write ("Usage: " + name
+ " [options] INFILE OUTFILE\n"
32 + "Convert (some) latin1 chars to html &xxx;\n\n"
34 + " -h, --help print this help\n"
35 + " -p, --package=DIR specify package\n"
39 # chars = {'è':'è', }
76 def convert_accents (inname
, outname
):
80 html
= File (outname
, 'w')
82 while not text
.eof ():
83 line
= text
.readline ()
84 for i
in chars
.keys ():
85 line
= regsub
.gsub (i
, chars
[i
], line
)
92 (options
, files
) = getopt
.getopt (
93 sys
.argv
[1:], 'hp:', ['help', 'package='])
97 if o
== '--help' or o
== '-h':
99 elif o
== '-p' or o
== '--package':
105 sys
.path
.append (topdir
+ '/stepmake/bin')
106 from packagepython
import *
107 package
= Package (topdir
)
108 packager
= Packager ()
112 convert_accents (files
[0], files
[1])