
On 2/8/09 05:25, Aaron Spike wrote:
~suv wrote:
On 31/7/09 15:49, Tavmjong Bah wrote:
General comment: I am having trouble getting Uniconvertor to work from within Inkscape. It won't process files with text (error message about not finding correct font). Files without text produce SVG output (Uniconvertor 1.1.4), independent of which file type is selected. Or error message about not finding SVG file in /tmp (Uniconvertor 1.1.3). I may have screwed something up but Uniconvertor does work when used via the command line (as in "uniconv test.svg test.plt") to directly convert SVG files to other types. Does anybody have it working from within Inkscape under Linux?
Comments in 'extensions/run_command.py' say: "Module for running SVG-generating commands in Inkscape extensions". Nevertheless it is called when 'uniconv-ext.py' is used in these output extensions:
plt_output.inx sk1_output.inx wmf_output.inx
This might explain why uniconv works on the command line (tested on OS X 10.5.7, python2.5, uniconverter 1.1.3, Inkscape r21939) but not when used by Inkscape with an export extension. I did not test files with text though - my test file just contained a simple shape and always resulted in a svg file when saved as *.plt, *.sk1 or *.wmf.
Looking at the run_command.py source, its supposed to fail noisily. Run inkscape from a terminal once and see what output you find on the console. Or instead of running uniconv directly try formulating the command that inkscape would execute with run_command.py
'run_command.py' doesn't fail - it just defaults to .svg as target file type - thus uniconv wrongly converts from 'any' to 'svg' when called from an output extension. It works as expected with input extensions.
I couldn't capture failure messages, the only I have is when uniconv failed because I hadn't yet installed py25-pil and py25-reportlab: It's an Inkscape extension failure message I got when saving 'spiral.svg' as 'spiral.sk1' (sK1 vector graphics files).
| UniConvertor failed: | PYTHONHOME: /Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/ | args: /var/folders/Bx/BxOeEE6mE3OWCL6lydnpAE+++TQ/-Tmp-/ink_ext_XXXXXX.svg5FEFYU /var/folders/Bx/BxOeEE6mE3OWCL6lydnpAE+++TQ/-Tmp-/tmpAfqhs6.svg | | Traceback (most recent call last): | File "<string>", line 1, in <module> | File "/Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/uniconvertor/__init__.py", line 76, in uniconv | from app.io import load | File "/Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/uniconvertor/app/__init__.py", line 69, in <module> | from conf.configurator import Configurator | File "/Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/uniconvertor/app/conf/configurator.py", line 11, in <module> | from app.events import connector | File "/Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/uniconvertor/app/__init__.py", line 125, in <module> | _import_PIL() | File "/Volumes/blue/mp/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/uniconvertor/app/__init__.py", line 114, in _import_PIL | warn.warn(warn.USER, "Can't import the Python Imaging Library") | NameError: global name 'warn' is not defined
the first two lines are debug 'echo' commands I added to the 'uniconv' shell script that then calls | /Volumes/blue/mp/bin/python -c "from uniconvertor import uniconv; uniconv();" "$@" As you can see the arguments to uniconv are two temp files, and the target file (for an export to *.sk1) is set to '.svg' instead of '.sk1'
OTOH I'm a python newbie and my python and uniconv installation used is not in the default system path - so any comments from linux/windows users with standard python installations would be helpful!
~suv