X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Flilypond-book.py;h=9c49508d7a85bfba912400108a31d345be678b97;hb=ca6e130e62a717b99db393f7262c9b34cb3d127d;hp=7fcec344de7088fe26e6a2f2ddab250b4a2a13e4;hpb=30339cb3706f6399c84607426988b25f79b4998c;p=lilypond.git diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 7fcec344de..9c49508d7a 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -277,6 +277,11 @@ if 'bindir' in globals () and bindir: if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary): lilypond_binary = 'lilypond' +# Need to shell-quote, issue 3468 + +import pipes +lilypond_binary = pipes.quote (lilypond_binary) + global_options = None @@ -544,10 +549,12 @@ def do_file (input_filename, included=False): in_handle = file (input_fullname) if input_filename == '-': + global_options.input_dir = os.getcwd () input_base = 'stdin' elif included: input_base = os.path.splitext (input_filename)[0] else: + global_options.input_dir = os.path.split (input_absname)[0] input_base = os.path.basename ( os.path.splitext (input_filename)[0]) @@ -616,7 +623,7 @@ def inverse_relpath (path, relpath): return the first path relative to the second.""" if os.path.isabs (relpath): return os.path.abspath (path) - relparts = [''] + relparts = [] parts = os.path.normpath (path).split (os.path.sep) for part in os.path.normpath (relpath).split (os.path.sep): if part == '..': @@ -644,14 +651,14 @@ def do_options (): global_options.output_dir = os.path.expanduser (global_options.output_dir) global_options.include_path.insert (0, inverse_relpath (original_dir, global_options.output_dir)) - global_options.include_path.insert (0, ".%s" % os.path.sep) + global_options.include_path.insert (0, ".") # Load the python packages (containing e.g. custom formatter classes) # passed on the command line nr = 0 for i in global_options.custom_packages: nr += 1 - print imp.load_source ("book_custom_package%s" % nr, i) + progress (str(imp.load_source ("book_custom_package%s" % nr, i))) if global_options.warranty: