Mercurial > dottes
comparison makeBookeTunePages.sh @ 586:daa3b76bd11f
More abcfield.py updates and mark it Python 3.
- Move title fixups into Python.
- Move key display name expansion into Python.
- Add Dottes-specific header continuation line format. None of the usual
tools appears to support the official +: continuation.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Mon, 31 Oct 2016 23:48:45 +0000 |
parents | 760d0ae5acea |
children | afc031477784 |
comparison
equal
deleted
inserted
replaced
585:0a2fc73ba5ec | 586:daa3b76bd11f |
---|---|
5 # directory. | 5 # directory. |
6 # | 6 # |
7 # All EPS and PDF tune graphics must be present already. Run | 7 # All EPS and PDF tune graphics must be present already. Run |
8 # makeGraphics.sh to make these. | 8 # makeGraphics.sh to make these. |
9 # | 9 # |
10 | |
11 # Restore titles like 'Exploding Potato, The' to the | |
12 # expected 'The Exploding Potato'. | |
13 fixtitle() | |
14 { | |
15 retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` | |
16 } | |
17 | 10 |
18 if [ $# != 1 ]; then | 11 if [ $# != 1 ]; then |
19 echo "Usage: makeBookeTunePages.sh <book dir name>" | 12 echo "Usage: makeBookeTunePages.sh <book dir name>" |
20 exit 1 | 13 exit 1 |
21 fi | 14 fi |
36 # centre section, so the document. Then add a TOC entry. | 29 # centre section, so the document. Then add a TOC entry. |
37 find $booke -name "*.abc" | sort | | 30 find $booke -name "*.abc" | sort | |
38 while read filename | 31 while read filename |
39 do | 32 do |
40 name=`basename $filename .abc` | 33 name=`basename $filename .abc` |
41 title=`$dir/abcfield.py --field T --latex $filename` | 34 title=`$dir/abcfield.py --field T --latex --display $filename` |
42 fixtitle "$title" | 35 subtitle=`$dir/abcfield.py --index 2 --field T --latex --display $filename` |
43 title=$retval | |
44 subtitle=`$dir/abcfield.py --index 2 --field T --latex $filename` | |
45 fixtitle "$subtitle" | |
46 subtitle=$retval | |
47 composer=`$dir/abcfield.py --field C --latex $filename` | 36 composer=`$dir/abcfield.py --field C --latex $filename` |
48 | 37 |
49 changefile=`$dir/abcfield.py --field N --starts "Change:" $filename` | 38 changefile=`$dir/abcfield.py --field N --starts "Change:" $filename` |
50 changename="" | 39 changename="" |
51 changetitle="" | 40 changetitle="" |
52 if [ -n "$changefile" ]; then | 41 if [ -n "$changefile" ]; then |
53 changename=`basename $changefile .abc` | 42 changename=`basename $changefile .abc` |
54 changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` | 43 changetitle=`$dir/abcfield.py --field T --latex --display $booke/$changefile` |
55 fixtitle "$changetitle" | |
56 changetitle=$retval | |
57 fi | 44 fi |
58 | 45 |
59 credit=`$dir/abcfield.py --field N --starts "Credit:" $filename` | 46 credit=`$dir/abcfield.py --field N --starts "Credit:" $filename` |
60 echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}{$credit}" >> $tunesoutput | 47 echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}{$credit}" >> $tunesoutput |
61 | 48 |