summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b04db4d)
raw | patch | inline | side by side (parent: b04db4d)
author | JazzyNico <JazzyNico@users.sourceforge.net> | |
Mon, 22 Jun 2009 20:55:27 +0000 (20:55 +0000) | ||
committer | JazzyNico <JazzyNico@users.sourceforge.net> | |
Mon, 22 Jun 2009 20:55:27 +0000 (20:55 +0000) |
share/extensions/svg_and_media_zip_output.py | patch | blob | history |
diff --git a/share/extensions/svg_and_media_zip_output.py b/share/extensions/svg_and_media_zip_output.py
index 67cabdf22f00b3c93932334381040ae69efd71b0..88c294245283617390c7bf12dd0b64114f8407b1 100644 (file)
- maybe add better extention
"""
-import inkex, os.path
+import inkex, os.path, urlparse, urllib
import os
import string
import zipfile
def collectAndZipImages(self, node, docname, z):
xlink = node.get(inkex.addNS('href',u'xlink'))
if (xlink[:4]!='data'):
- absref = node.get(inkex.addNS('absref',u'sodipodi'))
- if absref is None:
- absref = node.get(inkex.addNS('href',u'xlink'))
+ absref=node.get(inkex.addNS('absref','sodipodi'))
+ url=urlparse.urlparse(xlink)
+ href=urllib.unquote(url.path)
+ if os.name == 'nt' and href[0] == '/':
+ href = href[1:]
+ if (href != None):
+ absref=os.path.realpath(href)
+
if (os.path.isfile(absref)):
shutil.copy(absref, self.tmp_dir)
z.write(absref.encode("latin-1"),os.path.basename(absref).encode("latin-1"))