attached is the single svg file obtained from the tar file.
- I was not exactly sure what to expect, but I think I expected 2 files, not one.
- also the single svg file produced, does not have a time stamp, which is very unusual
- also the svg file cannot be opened in my normal XML editor, I get a syntax error
- also, Inkscape 0.48.4 refuses to open this svg file
these may be deficiencies in my zip program, Winzip 6.3, any recommendations on which program to use (?), since this is not a normal zip format on Windows
yes, there appears to be a difference between the tar file I got on Windows and the tar file you got on OSX.
I used Winzip 6.3 to open your file 1286524Layertest-osx.tar and I got two svg files and they both opened normally in Inkscape.
just for fun, I put a tracer into the Python code to see if both layers are actually being processed. The code contains a branch depending on whether this is the first layer or a subsequent layer.
if previous != None:
inkex.errormsg("add new = " + name)
template.getroot().replace(previous, layer)
else:
inkex.errormsg("add org = " + name)
template.getroot().append(layer)
The tracer indicated that both branches were executed and that both layers were encountered, but apparently the second layer was subsequently lost somewhere.
I've pushed fixes for both the mtime and spelling mistake; but the windows issue is a mystery. There's not excepts catching errors so if we're not getting an error, it must be the python tarfile module.
I just ran the new version on Windows XP. I get the following Python error message:
Traceback (most recent call last):
File "tar_layers.py", line 114, in <module>
e.affect()
File "C:\InkscapeBZR\inkscape\share\extensions\inkex.py", line 261, in affect
self.effect()
File "tar_layers.py", line 109, in effect
tar.addfile(**self.io_document(name, template))
File "tar_layers.py", line 90, in io_document
info.mtime = int(datetime.now().strftime('%s'))
ValueError: invalid literal for int() with base 10: ''
attached is a slightly modified version of tar_layers.py. This version will produce an uptodate time stamp for the individual files on Windows XP.
Unfortunately, the tar file itself is still corrupt on Windows. It appears that the problem is related to the use of the CR/LF combo on Windows, instead of just a single CR.
attached is an improved version of the previous fix. This version will produce a correct tar file on Windows, by modifying the mode of sys.stdout. The Windows-specific fix was borrowed from jessyInk_export.py.
I wonder if this could be tested on a non-Windows platform to confirm that nothing has been broken?
attached is the tar file produced