Code

GNU/Linux!
[inkscape.git] / share / extensions / extractimage.py
index c85456c88bda1ad7640dffe032c68593cab4cb81..38f9298465d66191fd3eb9718dd08fb5f8a0c21c 100644 (file)
@@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 '''
 
 import inkex, base64, os
+import gettext
+_ = gettext.gettext
 
 class MyEffect(inkex.Effect):
     def __init__(self):
@@ -61,11 +63,12 @@ class MyEffect(inkex.Effect):
                                 open(path,'wb').write(data)
                                 node.set(inkex.addNS('href','xlink'),os.path.realpath(path)) #absolute for making in-mem cycles work
                             else:
-                                inkex.debug('Difficulty finding the image data.')
+                                inkex.errormsg(_('Difficulty finding the image data.'))
                             break
 
-e = MyEffect()
-e.affect()
+if __name__ == '__main__':
+    e = MyEffect()
+    e.affect()
 
 
 # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99