diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2009-12-16 20:31:01 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2009-12-16 20:31:01 +0000 |
| commit | 6be0b6d268b123d715186bf8eb927e1be6e7e096 (patch) | |
| tree | 675a7697c88ec062e0726b0b89d6db116bc8d052 | |
| parent | updating my email address in file headers (diff) | |
| download | inkscape-6be0b6d268b123d715186bf8eb927e1be6e7e096.tar.gz inkscape-6be0b6d268b123d715186bf8eb927e1be6e7e096.zip | |
Embedimage extension fix and stderr Unicode support in inkex.py
Fixed bugs:
- https://launchpad.net/bugs/386069
(bzr r8890)
| -rw-r--r-- | share/extensions/embedimage.py | 7 | ||||
| -rwxr-xr-x | share/extensions/inkex.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/share/extensions/embedimage.py b/share/extensions/embedimage.py index 16439223b..f73ceb358 100644 --- a/share/extensions/embedimage.py +++ b/share/extensions/embedimage.py @@ -56,9 +56,8 @@ class Embedder(inkex.Effect): if xlink is None or xlink[:5] != 'data:': 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:] + href=urllib.url2pathname(url.path) + path='' #path selection strategy: # 1. href if absolute @@ -70,6 +69,8 @@ class Embedder(inkex.Effect): if (absref != None): path=absref + path=unicode(path, "utf-8") + if (not os.path.isfile(path)): inkex.errormsg(_('No xlink:href or sodipodi:absref attributes found, or they do not point to an existing file! Unable to embed image.')) if path: diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py index d36820692..1a70c25d6 100755 --- a/share/extensions/inkex.py +++ b/share/extensions/inkex.py @@ -84,7 +84,7 @@ def errormsg(msg): ... inkex.errormsg(_("This extension requires two selected paths.")) """ - sys.stderr.write((str(msg) + "\n").encode("UTF-8")) + sys.stderr.write((unicode(msg) + "\n").encode("UTF-8")) def check_inkbool(option, opt, value): if str(value).capitalize() == 'True': |
