################################################################
# Users of python modules should include this snippet.
#
-libdir = '@local_lilypond_libdir@'
-if not os.path.isdir (libdir):
- libdir = '@lilypond_libdir@'
-
-# ugh
-datadir = '@local_lilypond_datadir@'
-if os.environ.has_key ('LILYPONDPREFIX'):
- datadir = os.environ['LILYPONDPREFIX']
- while datadir[-1] == os.sep:
- datadir= datadir[:-1]
- libdir = datadir.replace ('/share/', '/lib/')
-
-if os.path.exists (os.path.join (datadir, 'lib/lilypond/@TOPLEVEL_VERSION@/')):
- libdir = os.path.join (libdir, 'lib/lilypond/@TOPLEVEL_VERSION@/')
-
-if os.path.exists (os.path.join (datadir, 'lib/lilypond/current/')):
- libdir = os.path.join (libdir, 'lib/lilypond/current/')
-
-sys.path.insert (0, os.path.join (libdir, 'python'))
+
+
+
+
+for d in ['@lilypond_datadir@',
+ '@lilypond_libdir@']:
+ sys.path.insert (0, os.path.join (d, 'python'))
+
# dynamic relocation, for GUB binaries.
-bindir = os.path.split (sys.argv[0])[0]
+bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
for p in ['share', 'lib']:
datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
sys.path.insert (0, datadir)
+
################################################################
import lilylib as ly
return (string.atoi (dec), str)
else:
- sys.stderr.write ("can't convert `%s'\n" % str)
+ sys.stderr.write ("cannot convert `%s'\n" % str)
return (None, str)
def get_option_parser ():
- p = ly.get_option_parser (usage='etf2ly [OPTIONS]... ETF-FILE',
+ p = ly.get_option_parser (usage=_ ("%s [OPTION]... ETF-FILE") % 'etf2ly',
version="etf2ly (LilyPond) @TOPLEVEL_VERSION@",
- description=_("""Enigma Transport Format is a format used by Coda Music Technology's
-Finale product. This program will convert a subset of ETF to a
-ready-to-use lilypond file."""))
- p.add_option ('-o', '--output', help=_("write output to FILE"),
+ description=_ ("""Enigma Transport Format is a format used by Coda Music Technology's
+Finale product. etf2ly converts a subset of ETF to a ready-to-use LilyPond file."""))
+ p.add_option ('-o', '--output', help=_ ("write output to FILE"),
metavar=_("FILE"),
action='store')
- p.add_option ('-w', '--warranty', help=_ ("show warranty"),
+ p.add_option ('-w', '--warranty', help=_ ("show warranty and copyright"),
action='store_true',
),
- p.add_option_group ('bugs',
- description='''Report bugs via http://post.gmane.org/post.php'''
- '''?group=gmane.comp.gnu.lilypond.bugs\n''')
+ p.add_option_group ('bugs',
+ description=(_ ('Report bugs via')
+ + ''' http://post.gmane.org/post.php'''
+ '''?group=gmane.comp.gnu.lilypond.bugs\n'''))
return p
def do_options ():