X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fbook_base.py;h=1d0d9eca990407f3671a03c54af143515eef295e;hb=b872748c6aa8bb721ced458691b38ac2fac5dfc8;hp=b43b9e00d4b4477b5ea2fe0f05eea0be9e3ae8f5;hpb=f875ef39c544bd3499dae5360e9e24f69933575f;p=lilypond.git diff --git a/python/book_base.py b/python/book_base.py index b43b9e00d4..1d0d9eca99 100644 --- a/python/book_base.py +++ b/python/book_base.py @@ -14,9 +14,11 @@ error = ly.error # Helper functions ######################################################################## -def find_file (name, include_path, raise_error=True): - for i in include_path: +def find_file (name, include_path, working_dir=None, raise_error=True): + current_path = working_dir or os.getcwd(); + for i in [current_path] + include_path: full = os.path.join (i, name) + full = os.path.normpath (os.path.join (current_path, full)) if os.path.exists (full): return full @@ -149,7 +151,8 @@ class BookOutputFormat: return [] def input_fullname (self, input_filename): - return find_file (input_filename, self.global_options.include_path) + return find_file (input_filename, self.global_options.include_path, + self.global_options.original_dir) def adjust_snippet_command (self, cmd): return cmd