summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 60920b3)
raw | patch | inline | side by side (parent: 60920b3)
author | JazzyNico <JazzyNico@users.sourceforge.net> | |
Fri, 12 Jun 2009 12:45:35 +0000 (12:45 +0000) | ||
committer | JazzyNico <JazzyNico@users.sourceforge.net> | |
Fri, 12 Jun 2009 12:45:35 +0000 (12:45 +0000) |
share/extensions/embedimage.py | patch | blob | history |
index 93472b325104621dce2dc10a6a7f9f35b924ee2f..a6cef536373a98c94edefe1ee2d6438e3a73e4d2 100644 (file)
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
-import inkex, os, base64
+import inkex, os, base64, urlparse
import gettext
_ = gettext.gettext
xlink = node.get(inkex.addNS('href','xlink'))
if xlink is None or xlink[:5] != 'data:':
absref=node.get(inkex.addNS('absref','sodipodi'))
- href=xlink
+ url=urlparse.urlparse(xlink)
+ href=url.path
path=''
#path selection strategy:
# 1. href if absolute
# 2. realpath-ified href
# 3. absref, only if the above does not point to a file
if (href != None):
- if (os.path.isabs(href)):
- path=os.path.realpath(href)
- else:
- path=os.path.realpath(href)
+ path=os.path.realpath(href)
if (not os.path.isfile(path)):
if (absref != None):
path=absref