+ global_options.original_dir = original_dir
+
+ if global_options.lily_output_dir:
+ global_options.lily_output_dir = os.path.expanduser (global_options.lily_output_dir)
+ global_options.include_path.insert (0, inverse_relpath (original_dir, global_options.lily_output_dir))
+
+ if global_options.output_dir:
+ 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, ".")
+
+ # 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
+ progress (str(imp.load_source ("book_custom_package%s" % nr, i)))