El 28.10.2017 a las 19:25, Jürgen Spitzmüller escribió:
It should be quoted. You can check via the messages pane.
Hi Jürgen,
sorry I did not have time to look closer up to now.
Nevertheless I cannot see the complete path behind $$p, all I get is this:
-------------------------------------------------------------------
from_file: D:/lyxdokumente/GraphicsTest/germany.emf
to_file_base:
C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/CacheItem.FS4192
from_format: emf
to_format: png
graphics/GraphicsConverter.cpp (287): build_script ...
graphics/GraphicsConverter.cpp (414): ready!
graphics/GraphicsConverter.cpp (155): Conversion script:
--------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys
def unlinkNoThrow(file):
''' remove a file, do not throw if an error occurs '''
try:
os.unlink(file)
except:
pass
infile = "D:/lyxdokumente/GraphicsTest/germany.emf"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.emf"
shutil.copy(infile, outfile)
os.chdir("C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/")
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.emf"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.eps"
outdir = os.path.dirname(outfile)
if os.system(r'inkscape --file=$$p' + '"' + infile + '"' + '
--export-area-drawing --without-gui --export-eps=$$p' + '"' + outfile +
'"' + '') != 0:
unlinkNoThrow(outfile)
sys.exit(1)
if not os.path.isfile(outfile):
if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
unlinkNoThrow(file)
else:
sys.exit(1)
if infile != outfile:
unlinkNoThrow(infile)
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.eps"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.png"
outdir = os.path.dirname(outfile)
...
-------------------------------------------------------------------
But
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.eps"
does not exist. So Inkscape did not create an EPS out of the EMF and
this is how I found the reason with the $$p in the path to Inkscape.
I am unable to see what is behind the $$p variable. I mean if I omit the
$$p variable as I did in my path for configure.py I get:
-------------------------------------------------------------------
from_file: D:/lyxdokumente/GraphicsTest/germany.emf
to_file_base:
C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/CacheItem.ji4192
from_format: emf
to_format: png
graphics/GraphicsConverter.cpp (287): build_script ...
graphics/GraphicsConverter.cpp (414): ready!
graphics/GraphicsConverter.cpp (155): Conversion script:
--------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys
def unlinkNoThrow(file):
''' remove a file, do not throw if an error occurs '''
try:
os.unlink(file)
except:
pass
infile = "D:/lyxdokumente/GraphicsTest/germany.emf"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.emf"
shutil.copy(infile, outfile)
os.chdir("C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/")
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.emf"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.eps"
outdir = os.path.dirname(outfile)
if os.system(r'inkscape --file=' + '"' + infile + '"' + '
--export-area-drawing --without-gui --export-eps=' + '"' + outfile + '"'
+ '') != 0:
unlinkNoThrow(outfile)
sys.exit(1)
if not os.path.isfile(outfile):
if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
unlinkNoThrow(file)
else:
sys.exit(1)
if infile != outfile:
unlinkNoThrow(infile)
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.eps"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.png"
outdir = os.path.dirname(outfile)
-------------------------------------------------------------------
So to compare the relevant part we have:
- with $$p:
infile = "D:/lyxdokumente/GraphicsTest/germany.emf"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.emf"
shutil.copy(infile, outfile)
os.chdir("C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/")
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.emf"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertRR4192.eps"
outdir = os.path.dirname(outfile)
- without $$p:
infile = "D:/lyxdokumente/GraphicsTest/germany.emf"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.emf"
shutil.copy(infile, outfile)
os.chdir("C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/")
infile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.emf"
infile_base =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192"
outfile =
"C:/Users/Usti/AppData/Local/Temp/lyx_tmpdir.ZcmDkPdt4192/gconvertHU4192.eps"
outdir = os.path.dirname(outfile)
I cannot see a difference but in the second case the EPS is successfully
created. So to me it seems that$$p does actually not store a path
because the path with and without $$p are identic.
thanks and regards
Uwe