diff makeBookeTunePages.sh @ 326:27f29e8aafea

Add --contains flag to abcfield.py. Currently we rely on any N: field with a Change: subnotice being the first N: field. Add --contains field to abcfield.py to remove this restriction. Also use it to extract new subfield Credit: and add that if present to the tune information in print and on web.
author Jim Hague <jim.hague@acm.org>
date Sun, 04 Aug 2013 22:09:25 +0100
parents 1a240d1e2032
children b44fbcaeba38
line wrap: on
line diff
--- a/makeBookeTunePages.sh	Sun Aug 04 21:28:05 2013 +0100
+++ b/makeBookeTunePages.sh	Sun Aug 04 22:09:25 2013 +0100
@@ -44,7 +44,7 @@
         subtitle=`$dir/abcfield.py --index 2 --field T --latex $filename`
         composer=`$dir/abcfield.py --field C --latex $filename`
 
-        changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"`
+        changefile=`$dir/abcfield.py --field N --contains "Change:" $filename | sed -e "s/Change: *//"`
         changename=""
         changetitle=""
         if [ -n "$changefile" ]; then
@@ -53,7 +53,9 @@
             fixtitle "$changetitle"
             changetitle=$retval
         fi
-        echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}" >> $tunesoutput
+
+        credit=`$dir/abcfield.py --field N --contains "Credit:" $filename | sed -e "s/Credit: *//"`
+        echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}{$credit}" >> $tunesoutput
 
         echo -E "\showfirstline{$name}{$title}{$graphicsdir/firstline-$name}" >> $indexoutput
     done