From 37082ba067de04d1892a514df2e08f34b91829ac Mon Sep 17 00:00:00 2001 From: Phil Holmes Date: Sat, 25 Feb 2012 15:23:29 +0000 Subject: [PATCH] Removes mutopia-index.py processing --- GNUmakefile.in | 5 +- scripts/build/mutopia-index.py | 197 --------------------------------- 2 files changed, 1 insertion(+), 201 deletions(-) delete mode 100644 scripts/build/mutopia-index.py diff --git a/GNUmakefile.in b/GNUmakefile.in index bd2d0ce5a3..2d22f9f378 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -133,15 +133,12 @@ WEB_TRACKED_FILES = $(filter-out $(outdir)/index.html, \ $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") \ $(shell bash -O nullglob -c "echo Documentation/$(outdir)/*/*.{midi,html,pdf,png,jpg,jpeg,txt,ly,ily,signature,css,zip,js,idx,php}") -WWW-post: $(top-build-dir)/.htaccess $(outdir)/examples.html $(WEB_ROOT_FILES) +WWW-post: $(top-build-dir)/.htaccess $(WEB_ROOT_FILES) # need UTF8 setting in case this is hosted on a website. $(top-build-dir)/.htaccess: echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(top-build-dir)/.htaccess -$(outdir)/examples.html: $(WEB_EXAMPLE_FILES) - $(buildscript-dir)/mutopia-index -o $(outdir)/examples.html input/ - $(outdir)/offline-root/index.html: $(WEB_TRACKED_FILES) $(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) offline find $(outdir)/offline-root -type l | xargs rm -f diff --git a/scripts/build/mutopia-index.py b/scripts/build/mutopia-index.py deleted file mode 100644 index 31fa6ac492..0000000000 --- a/scripts/build/mutopia-index.py +++ /dev/null @@ -1,197 +0,0 @@ -#!@PYTHON@ -# mutopia-index.py - -import fnmatch -import getopt -import os -import re -import stat -import sys - -def find (pat, dir): - f = os.popen ('find %s -name "%s"'% (dir, pat)) - lst = [] - for a in f.readlines(): - a = a[:-1] - lst.append (a) - return lst - - -junk_prefix = 'out-www/' - -headertext= r""" - -

LilyPond samples

- - -

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

- -The pictures are 90 dpi anti-aliased snapshots of the printed output. -For a good impression of the quality print out the PDF file. -""" - -headertext_nopics= r""" -

No examples were found in this directory. -""" - -# -# FIXME breaks on multiple strings. -# -def read_lilypond_header (fn): - s = open (fn).read () - s = re.sub ('%.*$', '', s) - s = re.sub ('\n', ' ', s) - - dict = {} - m = re.search (r"""\\header\s*{([^}]*)}""", s) - - if m: - s = m.group (1) - else: - return dict - - while s: - m = re.search (r'''\s*(\S+)\s*=\s*"([^"]+)"''', s) - if m == None: - s = '' - else: - s = s[m.end (0):] - left = m.group (1) - right = m.group (2) - - left = re.sub ('"', '', left) - right = re.sub ('"', '', right) - dict[left] = right - - return dict - -def help (): - 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 - -s, --subdirs=DIR add subdir - --suffix=SUF specify suffix - -''') - sys.exit (0) - -# ugh. -def gen_list (inputs, file_name): - sys.stderr.write ("generating HTML list %s" % file_name) - sys.stderr.write ('\n') - if file_name: - list = open (file_name, 'w') - else: - list = sys.stdout - list.write ('''Rendered Examples - - -''') - - list.write ('\n') - - if inputs: - list.write (headertext) - else: - list.write (headertext_nopics) - - for ex in inputs: - print ex - - (base, ext) = os.path.splitext (ex) - (base, ext2) = os.path.splitext (base) - ext = ext2 + ext - - header = read_lilypond_header (ex) - head = header.get ('title', os.path.basename (base)) - composer = header.get ('composer', '') - desc = header.get ('description', '') - list.write ('


\n') - list.write ('

%s

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

%s

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

' % desc) - list.write ('

\n'); - - list.write ('\n'); - list.close () - -(options, files) = getopt.getopt (sys.argv[1:], - 'ho:', ['help', 'output=']) -outfile = 'examples.html' - -subdirs = [] -for (o, a) in options: - if o == '--help' or o == '-h': - help () - elif o == '--output' or o == '-o': - outfile = a - -dirs = [] -for f in files: - dirs += find ('out-www', f) - -if not dirs: - dirs = ['.'] - -allfiles = [] - -for d in dirs: - allfiles += find ('*.ly', d) - -allfiles = [f for f in allfiles - if not f.endswith ('snippet-map.ly') - and not re.search ('lily-[0-9a-f]+', f) - and 'musicxml' not in f] - -gen_list (allfiles, outfile) -- 2.39.2