+################################################################
+# Users of python modules should include this snippet
+# and customize variables below.
+
+# We'll suffer this path init stuff as long as we don't install our
+# python packages in <prefix>/lib/pythonx.y (and don't kludge around
+# it as we do with teTeX on Red Hat Linux: set some environment var
+# (PYTHONPATH) in profile)
+
+# If set, LILYPONDPREFIX must take prevalence
+# if datadir is not set, we're doing a build and LILYPONDPREFIX
+import getopt, os, sys
+datadir = '@local_lilypond_datadir@'
+if not os.path.isdir (datadir):
+ datadir = '@lilypond_datadir@'
+if os.environ.has_key ('LILYPONDPREFIX') :
+ datadir = os.environ['LILYPONDPREFIX']
+ while datadir[-1] == os.sep:
+ datadir= datadir[:-1]
+
+sys.path.insert (0, os.path.join (datadir, 'python'))
+
+# Customize these
+#if __name__ == '__main__':
+
+import lilylib as ly
+global _;_=ly._
+global re;re = ly.re
+
+# lilylib globals
+program_name = 'lilypond-book'
+verbose_p = 0
+pseudo_filter_p = 0
+original_dir = os.getcwd ()
+#temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
+#urg
+temp_dir = '/tmp'
+keep_temp_dir_p = 0
+preview_resolution = 90
+
+## FIXME
+## ly2dvi: silly name?
+## do -P or -p by default?
+##help_summary = _ ("Run LilyPond using LaTeX for titling")
+help_summary = _ ("Process LilyPond snippets in hybrid html, LaTeX or texinfo document")
+copyright = ('Tom Cato Amundsen <tca@gnu.org>',
+ 'Han-Wen Nienhuys <hanwen@cs.uu.nl>')
+
+option_definitions = [
+ (_ ("EXT"), 'f', 'format', _ ("use output format EXT (texi [default], texi-html, latex, html)")),
+ (_ ("DIM"), '', 'default-music-fontsize', _ ("default fontsize for music. DIM is assumed to be in points")),
+ (_ ("DIM"), '', 'default-lilypond-fontsize', _ ("deprecated, use --default-music-fontsize")),
+ (_ ("OPT"), '', 'extra-options', _ ("pass OPT quoted to the lilypond command line")),
+ (_ ("DIM"), '', 'force-music-fontsize', _ ("force fontsize for all inline lilypond. DIM is assumed be to in points")),
+ (_ ("DIM"), '', 'force-lilypond-fontsize', _ ("deprecated, use --force-music-fontsize")),
+ ('', 'h', 'help', _ ("this help")),
+ (_ ("DIR"), 'I', 'include', _ ("include path")),
+ ('', 'M', 'dependencies', _ ("write dependencies")),
+ (_ ("PREF"), '', 'dep-prefix', _ ("prepend PREF before each -M dependency")),
+ ('', 'n', 'no-lily', _ ("don't run lilypond")),
+ ('', '', 'no-pictures', _ ("don't generate pictures")),
+ ('', '', 'no-music', _ ("strip all lilypond blocks from output")),
+ (_ ("FILE"), 'o', 'outname', _ ("filename main output file")),
+ (_ ("FILE"), '', 'outdir', _ ("where to place generated files")),
+ (_ ('RES'), '', 'preview-resolution',
+ _ ("set the resolution of the preview to RES")),
+ ('', 'V', 'verbose', _ ("verbose")),
+ ('', 'v', 'version', _ ("print version information")),
+ ('', 'w', 'warranty', _ ("show warranty and copyright")),
+ ]
+
+# format specific strings, ie. regex-es for input, and % strings for output
+
+# global variables
+
+include_path = [os.getcwd ()]
+
+
+#lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
+
+lilypond_binary = os.path.join ('@bindir@', 'lilypond')
+
+# only use installed binary when we're installed too.
+if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
+ lilypond_binary = 'lilypond'