Export layout extension error

Bug #563722 reported by jazzynico on 2010-04-15
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Aurium

Bug Description

Inkscape bzr rev. 9315, Windows XP.

Applying the Extensions>Web>Slicer>Export layout pieces and HTML+CSS code... extension outputs the following error:

----
File "webslicer_export.py", line 61
    except Exception as e:
                      ^
SyntaxError: invalid syntax
----

"except Exception as variable" is the new python 3 syntax, back-ported to python 2.6 but not to python 2.5, which is installed with the Windows version. This is a potential issue for some Linux distros and OSX versions too.

Thus, we should use the old "except Exception, variable" syntax instead of the new one.

jazzynico (jazzynico) on 2010-04-15
tags: added: extensions-plugins
Changed in inkscape:
assignee: nobody → Aurium (aurium)
Alvin Penner (apenner) wrote :

confirmed on Windows XP, bzr rev 9353

Changed in inkscape:
status: New → Confirmed
Leif Linse (leif-linse) wrote :

I'm using the windows version of the 0.48 prerelease on Windows Vista 32 bit.

My python version is 2.6.5 of the system python installation (available in PATH). I don't know if Inkscape use it or has its own python interpreter that is bundled with it to make sure everyone use the same version.

I've never used the slicer tool before so I could have missed something, but when I try to export using the slicer tool to "C:\" I get the following error message:

---
Traceback (most recent call last):

  File "webslicer_export.py", line 421, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 215, in affect

    self.effect()

  File "webslicer_export.py", line 110, in effect

    self.export_chids_of( self.get_slicer_layer() )

  File "webslicer_export.py", line 203, in export_chids_of

    self.register_unity_code( el, el_conf, parent_id )

  File "webslicer_export.py", line 261, in register_unity_code

    geo = self.get_relative_el_geometry(el,True)

  File "webslicer_export.py", line 302, in get_relative_el_geometry

    geometry = self.el_geo[el.attrib['id']]

KeyError: 'TestApa2'
---

I don't know if it is related to the issues of the original bug posting other than that it seems to happen after the same user actions.

Leif Linse (leif-linse) wrote :

Forgot to add that the above error message is only displayed if I choose to export html+css. If I unmark that checkbox then no errors are printed but the output text window still appears. Also there is still no image files created on the file system.

jazzynico (jazzynico) on 2010-08-19
Changed in inkscape:
milestone: 0.48 → 0.48.1
Andrew Noble (noblestudd) wrote :

Hi Leif,

I also had that same error. But I think is the usage of webslicer that's causing it. Try moving the slicer rectangle out of Web Slicer layer and into your target layer that contain the images you want to slice. I think the error was caused by having an empty pixel under the slicer rectangle.

But still there's no output. I think this was caused by the python "command.getstatusoutput" which from what I've read is only native to UNIX system. Thus I'm getting a python output for command.getstatusoutput('convert --version') of:
(1, "'{' is not recognized as an internal or external command,\noperable program or batch file.")

I think webslicer uses that command to check for imagemagick installation to dump JPG and GIF.

Emkeyen (emkeyen) wrote :

With Windows dev build inkscaper9712-1008140955.7z I get

Traceback (most recent call last):

  File "webslicer_export.py", line 421, in <module>

    e.affect()

  File "D:\Temp\_DL\inkscape\share\extensions\inkex.py", line 216, in affect

    self.effect()

  File "webslicer_export.py", line 110, in effect

    self.export_chids_of( self.get_slicer_layer() )

  File "webslicer_export.py", line 198, in export_chids_of

    self.register_group_code( el, el_conf )

  File "webslicer_export.py", line 211, in register_group_code

    geometry = self.get_relative_el_geometry(group)

  File "webslicer_export.py", line 302, in get_relative_el_geometry

    geometry = self.el_geo[el.attrib['id']]

KeyError: 'g3890'

...

Unchecking With HTML and CSS gives:

You must install the ImageMagick to get JPG and GIF.

You must install the ImageMagick to get JPG and GIF.

You must install the ImageMagick to get JPG and GIF.

Traceback (most recent call last):

  File "webslicer_export.py", line 421, in <module>

    e.affect()

  File "D:\Temp\_DL\inkscape\share\extensions\inkex.py", line 216, in affect

    self.effect()

  File "webslicer_export.py", line 116, in effect

    self.delete_the_temporary_svg()

  File "webslicer_export.py", line 158, in delete_the_temporary_svg

    os.remove( self.tmp_svg )

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\docume~1\\mikael\\locals~1\\temp\\tmptjbhi3.svg'

...

Got everything in Web Slicer layer, trying to export as PNG with CSS.

Aurium (aurium) on 2010-11-03
Changed in inkscape:
status: Confirmed → Fix Committed
Aurium (aurium) wrote :

I commit some changes on revision 9873 to try to correct the command execution on windows (i don't have a machine with it to test). That appear to be the real problem, i hope that will to help.

If somebody still having problems, please comment here, if you confirm the solution works, please, close this bug.

Thanks,
 Aurium

jazzynico (jazzynico) wrote :

Fix confirmed on Windows XP. Thanks!

jazzynico (jazzynico) wrote :

And no regression on Ubuntu 10.04.
Also committed in the 0.48.x branch, revision 9723.

jazzynico (jazzynico) on 2011-03-05
Changed in inkscape:
status: Fix Committed → Fix Released

Dear Aurium and JazzyNico, please let me know what is the fix for the trouble what applying the Extensions>Web>Slicer>Export layout pieces and HTML+CSS code... extension outputs the following errors:

Traceback (most recent call last):

  File "webslicer_export.py", line 437, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 215, in affect

    self.effect()

  File "webslicer_export.py", line 132, in effect

    self.delete_the_temporary_svg()

  File "webslicer_export.py", line 174, in delete_the_temporary_svg

    os.remove( self.tmp_svg )

WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\docume~1\\user\\locals~1\\temp\\tmpfhofeh.svg'

I use Windows XP Pro 32 Bits , Phyton 2.6 and Inkscape 0.48.1-2.exe . Of other hand I replaced in the extensions folder the webslicer files with ones of November 2010 that you suggested and put togther in the webslicer.tgz file.

Thank you

jazzynico (jazzynico) wrote :

Not reproduced on Windows XP, Inkscape trunk revision 10145 and 0.48.1, with a minimal test file.
Could you please give the steps to reproduce this issue and attach the failing SVG file so that we can investigate?
Thanks.

Hello JazzyNico, thank you for your answer. Here I attached the failing SVG file. I followed the steps indicated in the pdf book: 2688-chapter-2-designing-site-layouts .pdf. I believe that all was well until the export moment.

Thank you for your help.

jazzynico (jazzynico) wrote :

Hello,

Your file works as expected on Ubuntu 10.10, Inkscape 0.48 and trunk revision 10184, and on windows XP, trunk revision 10145.
Everything is exported as viewed on the canvas (you must remove the hide status of the exported layer, or it's exported as a blank zone).

You wrote that you replaced the original extension files with new ones. Could you please reinstall the original files (available in the launchpad site: http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/files/head:/share/extensions/) and confirm you still have this issue?

Regards.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers