X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fmutopia-index.py;h=947e4ea316969fe1d6ebe7e0edbbcd4f14dcbe59;hb=c1fb671679be258cbd68c6ee00885a0bfbb30372;hp=4bbc0bb2c58416688cf728ffb058cc528d3866cd;hpb=12a99f3c1730cf0c59e2ac4955ed7db4f52aaf61;p=lilypond.git diff --git a/buildscripts/mutopia-index.py b/buildscripts/mutopia-index.py old mode 100755 new mode 100644 index 4bbc0bb2c5..947e4ea316 --- a/buildscripts/mutopia-index.py +++ b/buildscripts/mutopia-index.py @@ -3,7 +3,6 @@ name = 'mutopia-index' -# find.py -- deprecated in python 2.0 import fnmatch import os @@ -53,18 +52,24 @@ def file_exist_b (fn): headertext= r""" -

You're looking at a page with some LilyPond samples. -These files are also included in the distribution. The output is -completely generated by LilyPond, without any touch up by humans. -

The PostScript files were generated using TeX and dvips. The pictures -are 90dpi anti-aliased snapshots of the printed output. The images -are in PNG format, and should be viewable with any current browser. +

You're looking at a page with some LilyPond samples. These files +are also included in the distribution. The output is completely +generated from the .ly source file, without any further touch +up. + +

+ +The pictures are 90 dpi anti-aliased snapshots of the printed output. +If you want a better impression of the appearance, do print out one of +the PDF or PostScript files; they use scalable fonts, and should look +good at any resolution. -

If you want a better impression of the appearance, do print out one of -the postscript files. """ +headertext_nopics= r""" +

Nothing to be seen here, move along. +""" # # FIXME breaks on multiple strings. @@ -83,7 +88,7 @@ def read_lilypond_header (fn): return dict while s: - m = re.search (r"""\s*(\S+)\s*=\s*([^;]+)\s*;""", s) + m = re.search (r'''\s*(\S+)\s*=\s*"([^"]+)"''', s) if m == None: s = '' else: @@ -98,13 +103,16 @@ def read_lilypond_header (fn): return dict def help (): - sys.stdout.write (r"""Usage: mutopia-index [options] INFILE OUTFILE -Generate index for mutopia\n + sys.stdout.write (r"""Usage: mutopia-index [OPTIONS] INFILE OUTFILE +Generate index for mutopia. + Options: -h, --help print this help - -o,-output=FILE write output to file. + -o, --output=FILE write output to file -s, --subdirs=DIR add subdir - --suffix=SUF specify suffix""" + --suffix=SUF specify suffix + +""" ) sys.exit (0) @@ -115,7 +123,11 @@ def gen_list(inputs, filename): list = open(filename, 'w') else: list = sys.stdout - list.write ('Rendered Examples\n') + list.write ('Rendered Examples\n') + list.write ('\n') + list.write ('\n') if inputs: @@ -129,9 +141,7 @@ def gen_list(inputs, filename): (base, ext2) = os.path.splitext (base) ext = ext2 + ext - print '%s, ' % ex header = read_lilypond_header(ex) - def read_dict(s, default, h =header): try: ret = h[s] @@ -142,21 +152,26 @@ def gen_list(inputs, filename): composer = read_dict('composer', '') desc = read_dict('description', '') list.write('


\n') - list.write('

example file: %s

\n' % head); - if composer <> '': + list.write('

%s

\n' % head); + if composer: list.write('

%s

\n' % composer) - if desc <> '': + if desc: list.write('%s

' % desc) list.write ('

\n"); @@ -200,7 +216,5 @@ allfiles = [] for d in dirs: allfiles = allfiles + find ('*.ly.txt', d) -print allfiles - gen_list (allfiles, outfile)