From 77487ddf705ef1c74cf08dc43083e2f3a07d15e2 2013-07-05 15:19:19 From: Jonathan Frederic Date: 2013-07-05 15:19:19 Subject: [PATCH] Merge pull request #3539 from minrk/nbconvert_paths Don't hardcode posix paths in nbconvert --- diff --git a/IPython/nbconvert/exporters/exporter.py b/IPython/nbconvert/exporters/exporter.py index 92b7f6e..b8c33f6 100755 --- a/IPython/nbconvert/exporters/exporter.py +++ b/IPython/nbconvert/exporters/exporter.py @@ -93,11 +93,11 @@ class Exporter(Configurable): ) template_path = Unicode( - "/../templates/", config=True, + os.path.join("..", "templates"), config=True, help="Path where the template files are located.") template_skeleton_path = Unicode( - "/../templates/skeleton/", config=True, + os.path.join("..", "templates", "skeleton"), config=True, help="Path where the template skeleton files are located.") #Jinja block definitions @@ -288,11 +288,11 @@ class Exporter(Configurable): """ Create the Jinja templating environment. """ - + here = os.path.realpath(__file__) self.environment = Environment( loader=FileSystemLoader([ - os.path.dirname(os.path.realpath(__file__)) + self.template_path, - os.path.dirname(os.path.realpath(__file__)) + self.template_skeleton_path, + os.path.join(here, self.template_path), + os.path.join(here, self.template_skeleton_path), ]), extensions=JINJA_EXTENSIONS )