##// END OF EJS Templates
BUG: Fix savefig path in Windows...
Kevin Sheppard -
Show More
@@ -188,6 +188,7 b' To Do'
188 188 import atexit
189 189 import errno
190 190 import os
191 import pathlib
191 192 import re
192 193 import sys
193 194 import tempfile
@@ -415,11 +416,13 b' class EmbeddedSphinxShell(object):'
415 416 source_dir = self.source_dir
416 417 saveargs = decorator.split(' ')
417 418 filename = saveargs[1]
418 # insert relative path to image file in source (as absolute path for Sphinx)
419 outfile = '/' + os.path.relpath(os.path.join(savefig_dir,filename),
420 source_dir)
419 # insert relative path to image file in source
420 # as absolute path for Sphinx
421 # sphinx expects a posix path, even on Windows
422 posix_path = pathlib.Path(savefig_dir,filename).as_posix()
423 outfile = '/' + os.path.relpath(posix_path, source_dir)
421 424
422 imagerows = ['.. image:: %s'%outfile]
425 imagerows = ['.. image:: %s' % outfile]
423 426
424 427 for kwarg in saveargs[2:]:
425 428 arg, val = kwarg.split('=')
General Comments 0
You need to be logged in to leave comments. Login now