=== modified file 'share/extensions/convert2dashes.py' --- share/extensions/convert2dashes.py 2012-05-14 00:26:47 +0000 +++ share/extensions/convert2dashes.py 2012-10-07 07:47:16 +0000 @@ -20,10 +20,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' +# local library +import inkex +import cubicsuperpath +import bezmisc +import simplestyle -import inkex, cubicsuperpath, bezmisc, simplestyle -import gettext -_ = gettext.gettext +inkex.localize() def tpoint((x1,y1), (x2,y2), t = 0.5): return [x1+t*(x2-x1),y1+t*(y2-y1)] === modified file 'share/extensions/dimension.py' --- share/extensions/dimension.py 2011-11-21 20:58:06 +0000 +++ share/extensions/dimension.py 2012-10-07 07:47:16 +0000 @@ -32,16 +32,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import sys, inkex, pathmodifier -from simpletransform import * -import gettext -_ = gettext.gettext - +# standard library +import sys try: from subprocess import Popen, PIPE bsubprocess = True except: bsubprocess = False +# local library +import inkex +import pathmodifier +from simpletransform import * + +inkex.localize() class Dimension(pathmodifier.PathModifier): def __init__(self): @@ -127,7 +130,8 @@ try: testing_the_water = self.bbox[0] except TypeError: - sys.exit(_('Unable to process this object. Try changing it into a path first.')) + inkex.errormsg(_('Unable to process this object. Try changing it into a path first.')) + exit() layer = self.current_layer === modified file 'share/extensions/draw_from_triangle.py' --- share/extensions/draw_from_triangle.py 2011-11-21 20:58:06 +0000 +++ share/extensions/draw_from_triangle.py 2012-10-07 07:47:16 +0000 @@ -30,12 +30,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - +# standard library +import sys +from math import * +# local library import inkex -import simplestyle, sys, simplepath -from math import * -import gettext -_ = gettext.gettext +import simplestyle +import simplepath + +inkex.localize() #DRAWING ROUTINES === modified file 'share/extensions/dxf_outlines.py' --- share/extensions/dxf_outlines.py 2012-03-26 21:40:56 +0000 +++ share/extensions/dxf_outlines.py 2012-10-07 07:47:16 +0000 @@ -30,9 +30,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkex, simplestyle, simpletransform, cubicsuperpath, coloreffect, dxf_templates, math -import gettext -_ = gettext.gettext +# standard library +import math +# local library +import inkex +import simplestyle +import simpletransform +import cubicsuperpath +import coloreffect +import dxf_templates + +inkex.localize() try: from numpy import * === modified file 'share/extensions/embedimage.py' --- share/extensions/embedimage.py 2011-11-21 20:58:06 +0000 +++ share/extensions/embedimage.py 2012-10-07 07:47:16 +0000 @@ -16,10 +16,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' +# standard library +import base64 +import os +import sys +import urllib +import urlparse +# local library +import inkex -import inkex, os, base64, urlparse, urllib -import gettext -_ = gettext.gettext +inkex.localize() class Embedder(inkex.Effect): def __init__(self): @@ -74,7 +80,7 @@ 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: - inkex.errormsg(_("Sorry we could not locate %s") % path) + inkex.errormsg(_("Sorry we could not locate %s") % str(path)) if (os.path.isfile(path)): file = open(path,"rb").read() === modified file 'share/extensions/export_gimp_palette.py' --- share/extensions/export_gimp_palette.py 2011-11-21 20:58:06 +0000 +++ share/extensions/export_gimp_palette.py 2012-10-07 07:47:16 +0000 @@ -7,11 +7,19 @@ DOCNAME='sodipodi:docname' -import sys, simplestyle +# standard library +import sys +# third party try: from xml.dom.minidom import parse except: - sys.exit(_('The export_gpl.py module requires PyXML. Please download the latest version from http://pyxml.sourceforge.net/.')) + inkex.errormsg(_('The export_gpl.py module requires PyXML. Please download the latest version from http://pyxml.sourceforge.net/.')) + sys.exit() +# local library +import inkex +import simplestyle + +inkex.localize() colortags=(u'fill',u'stroke',u'stop-color',u'flood-color',u'lighting-color') colors={} === modified file 'share/extensions/extractimage.py' --- share/extensions/extractimage.py 2011-11-21 20:58:06 +0000 +++ share/extensions/extractimage.py 2012-10-07 07:47:16 +0000 @@ -16,10 +16,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' +# standard library +import base64 +import os +# local library +import inkex -import inkex, base64, os -import gettext -_ = gettext.gettext +inkex.localize() class MyEffect(inkex.Effect): def __init__(self): === modified file 'share/extensions/funcplot.py' --- share/extensions/funcplot.py 2011-11-21 20:58:06 +0000 +++ share/extensions/funcplot.py 2012-10-07 07:47:16 +0000 @@ -25,11 +25,15 @@ * 21-Jun-2007: Tavmjong: Added polar coordinates ''' -import inkex, simplepath, simplestyle +# standard library from math import * from random import * -import gettext -_ = gettext.gettext +# local library +import inkex +import simplepath +import simplestyle + +inkex.localize() def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bottom, fx = "sin(x)", fpx = "cos(x)", fponum = True, times2pi = False, polar = False, isoscale = True, drawaxis = True, endpts = False): === modified file 'share/extensions/gcodetools.py' --- share/extensions/gcodetools.py 2011-11-21 20:58:06 +0000 +++ share/extensions/gcodetools.py 2012-10-07 07:47:16 +0000 @@ -68,9 +68,7 @@ gcodetools_current_version = "1.7" -import inkex, simplestyle, simplepath -import cubicsuperpath, simpletransform, bezmisc - +# standard library import os import math import bezmisc @@ -82,9 +80,15 @@ import numpy import codecs import random -import gettext -_ = gettext.gettext +# local library +import inkex +import simplestyle +import simplepath +import cubicsuperpath +import simpletransform +import bezmisc +inkex.localize() ### Check if inkex has errormsg (0.46 version does not have one.) Could be removed later. if "errormsg" not in dir(inkex): === modified file 'share/extensions/generate_voronoi.py' --- share/extensions/generate_voronoi.py 2011-11-21 20:58:06 +0000 +++ share/extensions/generate_voronoi.py 2012-10-07 07:47:16 +0000 @@ -20,14 +20,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -import random, inkex, simplestyle, gettext, voronoi -_ = gettext.gettext +# standard library +import random +# local library +import inkex +import simplestyle +import voronoi + +inkex.localize() try: from subprocess import Popen, PIPE except: - inkex.errormsg(_("Failed to import the subprocess module. Please report this as a bug at : https://bugs.launchpad.net/inkscape.")) - inkex.errormsg("Python version is : " + str(inkex.sys.version_info)) + inkex.errormsg(_("Failed to import the subprocess module. Please report this as a bug at: https://bugs.launchpad.net/inkscape.")) + inkex.errormsg(_("Python version is: ") + str(inkex.sys.version_info)) exit() def clip_line(x1, y1, x2, y2, w, h): === modified file 'share/extensions/gimp_xcf.py' --- share/extensions/gimp_xcf.py 2012-03-04 21:01:03 +0000 +++ share/extensions/gimp_xcf.py 2012-10-07 07:47:16 +0000 @@ -18,17 +18,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - -import gettext +# standard library import os import shutil from subprocess import Popen, PIPE import sys import tempfile - +# local library import inkex -_ = gettext.gettext +inkex.localize() # Define extension exceptions class GimpXCFError(Exception): pass === modified file 'share/extensions/guides_creator.py' --- share/extensions/guides_creator.py 2009-04-13 20:05:53 +0000 +++ share/extensions/guides_creator.py 2012-10-07 07:47:16 +0000 @@ -43,18 +43,16 @@ import sys sys.path.append('/usr/share/inkscape/extensions') +from xml.etree import ElementTree as ET +# for golden number formulae +from math import sqrt + # We will use the inkex module with the predefined Effect base class. import inkex from simplestyle import * -from xml.etree import ElementTree as ET - -# for golden number formulae -from math import sqrt - -# for printing debugging output -import gettext -_ = gettext.gettext +# for localized debugging output +inkex.localize() def printDebug(string): inkex.errormsg(_(string)) === modified file 'share/extensions/guillotine.py' --- share/extensions/guillotine.py 2011-11-21 20:58:06 +0000 +++ share/extensions/guillotine.py 2012-10-07 07:47:16 +0000 @@ -37,22 +37,22 @@ etc. ''' - +# standard library +import locale import os import sys -import inkex -import simplestyle -import locale -import gettext -_ = gettext.gettext - -locale.setlocale(locale.LC_ALL, '') - try: from subprocess import Popen, PIPE bsubprocess = True except: bsubprocess = False +# local library +import inkex +import simplestyle + +inkex.localize() + +locale.setlocale(locale.LC_ALL, '') def float_sort(a, b): ''' === modified file 'share/extensions/inkex.py' --- share/extensions/inkex.py 2012-07-16 19:29:46 +0000 +++ share/extensions/inkex.py 2012-10-07 12:29:03 +0000 @@ -33,25 +33,8 @@ import random import re import sys - from math import * -domain = 'inkscape' -if sys.platform.startswith('win'): - import locale - current_locale, encoding = locale.getdefaultlocale() - os.environ['LANG'] = current_locale - try: - localdir = os.environ['INKSCAPE_LOCALEDIR']; - #sys.stderr.write(str(localdir) + "\n") - gettext= gettext.translation(domain, localdir, [current_locale], fallback=True) - except KeyError: - gettext= gettext.translation(domain, fallback=True) -else: - gettext= gettext.translation(domain, fallback=True) - -_ = gettext.gettext - #a dictionary of all of the xmlns prefixes in a standard inkscape doc NSS = { u'sodipodi' :u'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', @@ -65,6 +48,26 @@ u'xml' :u'http://www.w3.org/XML/1998/namespace' } +def localize(): + domain = 'inkscape' + if sys.platform.startswith('win'): + import locale + current_locale, encoding = locale.getdefaultlocale() + os.environ['LANG'] = current_locale + try: + localdir = os.environ['INKSCAPE_LOCALEDIR']; + trans = gettext.translation(domain, localdir, [current_locale], fallback=True) + except KeyError: + trans = gettext.translation(domain, fallback=True) + else: + try: + localdir = os.environ['PACKAGE_LOCALE_DIR']; + trans = gettext.translation(domain, localdir, fallback=True) + except KeyError: + trans = gettext.translation(domain, fallback=True) + #sys.stderr.write(str(localdir) + "\n") + trans.install() + #a dictionary of unit to user unit conversion factors uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866, 'km':3543307.0866, 'pc':15.0, 'yd':3240 , 'ft':1080} @@ -89,12 +92,6 @@ def uutounit(val, unit): return val/uuconv[unit] -try: - from lxml import etree -except Exception, e: - sys.exit(_("The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml\n\nTechnical details:\n%s" % (e,))) - - def debug(what): sys.stderr.write(str(what) + "\n") return what @@ -108,16 +105,24 @@ Note that this should always be combined with translation: - import gettext - _ = gettext.gettext + import inkex + inkex.localize() ... inkex.errormsg(_("This extension requires two selected paths.")) """ if isinstance(msg, unicode): - sys.stderr.write(_(msg).encode("UTF-8") + "\n") + sys.stderr.write(msg.encode("UTF-8") + "\n") else: - sys.stderr.write((unicode(_(msg), "utf-8", errors='replace') + "\n").encode("UTF-8")) + sys.stderr.write((unicode(msg, "utf-8", errors='replace') + "\n").encode("UTF-8")) +# third party library +try: + from lxml import etree +except Exception, e: + localize() + errormsg(_("The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml\n\nTechnical details:\n%s" % (e,))) + sys.exit() + def check_inkbool(option, opt, value): if str(value).capitalize() == 'True': return True === modified file 'share/extensions/interp_att_g.py' --- share/extensions/interp_att_g.py 2011-06-05 19:00:51 +0000 +++ share/extensions/interp_att_g.py 2012-10-07 07:47:16 +0000 @@ -16,9 +16,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkex, simplestyle, math, re, string -import gettext -_ = gettext.gettext +# standard library +import math +import re +import string +# local library +import inkex +import simplestyle + +inkex.localize() class InterpAttG(inkex.Effect): === modified file 'share/extensions/jessyInk_autoTexts.py' --- share/extensions/jessyInk_autoTexts.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_autoTexts.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,7 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext +inkex.localize() class JessyInk_AutoTexts(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_effects.py' --- share/extensions/jessyInk_effects.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_effects.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,7 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext +inkex.localize() class JessyInk_Effects(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_export.py' --- share/extensions/jessyInk_export.py 2010-10-29 17:09:35 +0000 +++ share/extensions/jessyInk_export.py 2012-10-07 07:47:16 +0000 @@ -30,8 +30,8 @@ import zipfile import glob import re -import gettext -_ = gettext.gettext + +inkex.localize() def propStrToDict(inStr): dictio = {} === modified file 'share/extensions/jessyInk_keyBindings.py' --- share/extensions/jessyInk_keyBindings.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_keyBindings.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() class JessyInk_CustomKeyBindings(inkex.Effect): modes = ('slide', 'index', 'drawing') === modified file 'share/extensions/jessyInk_masterSlide.py' --- share/extensions/jessyInk_masterSlide.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_masterSlide.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() class JessyInk_MasterSlide(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_mouseHandler.py' --- share/extensions/jessyInk_mouseHandler.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_mouseHandler.py 2012-10-07 07:47:16 +0000 @@ -27,8 +27,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() class JessyInk_CustomMouseHandler(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_summary.py' --- share/extensions/jessyInk_summary.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_summary.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() def propStrToList(str): list = [] @@ -71,7 +71,7 @@ inkex.errormsg(_("JessyInk script installed.")) slides = [] - masterSlide = None + masterSlide = None for node in self.document.xpath("//svg:g[@inkscape:groupmode='layer']", namespaces=inkex.NSS): if node.get("{" + inkex.NSS["jessyink"] + "}masterSlide"): === modified file 'share/extensions/jessyInk_transitions.py' --- share/extensions/jessyInk_transitions.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_transitions.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() class JessyInk_Transitions(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_video.py' --- share/extensions/jessyInk_video.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_video.py 2012-10-07 07:47:16 +0000 @@ -29,8 +29,8 @@ import re from lxml import etree from copy import deepcopy -import gettext -_ = gettext.gettext + +inkex.localize() class JessyInk_Effects(inkex.Effect): def __init__(self): === modified file 'share/extensions/jessyInk_view.py' --- share/extensions/jessyInk_view.py 2010-11-07 11:45:29 +0000 +++ share/extensions/jessyInk_view.py 2012-10-07 07:47:16 +0000 @@ -25,8 +25,8 @@ # We will use the inkex module with the predefined Effect base class. import inkex -import gettext -_ = gettext.gettext + +inkex.localize() def propStrToList(str): list = [] === modified file 'share/extensions/launch_webbrowser.py' --- share/extensions/launch_webbrowser.py 2012-06-15 15:52:29 +0000 +++ share/extensions/launch_webbrowser.py 2012-10-07 07:47:16 +0000 @@ -1,10 +1,11 @@ #!/usr/bin/env python -import gettext +# standard library import webbrowser import threading from optparse import OptionParser - -_ = gettext.gettext +# local library +import inkex +inkex.localize() class VisitWebSiteWithoutLockingInkscape(threading.Thread): def __init__(self): === modified file 'share/extensions/markers_strokepaint.py' --- share/extensions/markers_strokepaint.py 2012-02-09 05:25:41 +0000 +++ share/extensions/markers_strokepaint.py 2012-10-07 07:47:16 +0000 @@ -17,9 +17,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import random, inkex, simplestyle, copy -import gettext -_ = gettext.gettext +# standard library +import random +import copy +# local library +import inkex +import simplestyle + +inkex.localize() class MyEffect(inkex.Effect): def __init__(self): === modified file 'share/extensions/pathalongpath.py' --- share/extensions/pathalongpath.py 2011-11-21 20:58:06 +0000 +++ share/extensions/pathalongpath.py 2012-10-07 07:47:16 +0000 @@ -30,12 +30,19 @@ Now move and bend L to make it fit a skeleton, and see what happens to the normals: they move and rotate, deforming the pattern. ''' +# standard library +import copy +import math +import re +import random +# local library +import inkex +import cubicsuperpath +import bezmisc +import pathmodifier +import simpletransform -import inkex, cubicsuperpath, bezmisc -import pathmodifier,simpletransform -import copy, math, re, random -import gettext -_ = gettext.gettext +inkex.localize() def flipxy(path): for pathcomp in path: === modified file 'share/extensions/pathmodifier.py' --- share/extensions/pathmodifier.py 2011-11-21 20:58:06 +0000 +++ share/extensions/pathmodifier.py 2012-10-07 07:47:16 +0000 @@ -27,11 +27,19 @@ TODO: Several handy functions are defined, that might in fact be of general interest and that should be shipped out in separate files... ''' -import inkex, cubicsuperpath, bezmisc, simplestyle +# standard library +import copy +import math +import re +import random +# local library +import inkex +import cubicsuperpath +import bezmisc +import simplestyle from simpletransform import * -import copy, math, re, random -import gettext -_ = gettext.gettext + +inkex.localize() #################################################################### ##-- zOrder computation... === modified file 'share/extensions/pathscatter.py' --- share/extensions/pathscatter.py 2011-11-21 20:58:06 +0000 +++ share/extensions/pathscatter.py 2012-10-07 07:47:16 +0000 @@ -30,13 +30,21 @@ Now move and bend L to make it fit a skeleton, and see what happens to the normals: they move and rotate, deforming the pattern. ''' - -import inkex, cubicsuperpath, bezmisc -import pathmodifier, simpletransform +# standard library +import copy +import math +import re +import random +# third party from lxml import etree -import copy, math, re, random -import gettext -_ = gettext.gettext +# local library +import inkex +import cubicsuperpath +import bezmisc +import pathmodifier +import simpletransform + +inkex.localize() def zSort(inNode,idList): sortedList=[] === modified file 'share/extensions/perspective.py' --- share/extensions/perspective.py 2011-07-04 22:36:34 +0000 +++ share/extensions/perspective.py 2012-10-07 07:47:16 +0000 @@ -18,10 +18,26 @@ Perspective approach & math by Dmitry Platonov, shadowjack@mail.ru, 2006 """ -import sys, inkex, os, re, simplepath, cubicsuperpath, simpletransform, voronoi2svg -import gettext -_ = gettext.gettext +# standard library +import sys +import os +import re +try: + from subprocess import Popen, PIPE + bsubprocess = True +except: + bsubprocess = False +# local library +import inkex +import simplepath +import cubicsuperpath +import simpletransform +import voronoi2svg from ffgeom import * + +inkex.localize() + +# third party try: from numpy import * from numpy.linalg import * @@ -29,30 +45,6 @@ inkex.errormsg(_("Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again. On a Debian-like system this can be done with the command, sudo apt-get install python-numpy.")) exit() -try: - from subprocess import Popen, PIPE - bsubprocess = True -except: - bsubprocess = False - -uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'pc':15.0} -def unittouu(string): - unit = re.compile('(%s)$' % '|'.join(uuconv.keys())) - param = re.compile(r'(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)') - - p = param.match(string) - u = unit.search(string) - if p: - retval = float(p.string[p.start():p.end()]) - else: - retval = 0.0 - if u: - try: - return retval * uuconv[u.string[u.start():u.end()]] - except KeyError: - pass - return retval - class Project(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) === modified file 'share/extensions/polyhedron_3d.py' --- share/extensions/polyhedron_3d.py 2011-11-21 20:58:06 +0000 +++ share/extensions/polyhedron_3d.py 2012-10-07 07:47:16 +0000 @@ -48,12 +48,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - +# standard library +import sys +import re +from math import * +# local library import inkex -import simplestyle, sys, re -from math import * -import gettext -_ = gettext.gettext +import simplestyle + +inkex.localize() + +# third party try: from numpy import * except: === modified file 'share/extensions/render_alphabetsoup.py' --- share/extensions/render_alphabetsoup.py 2011-11-21 20:58:06 +0000 +++ share/extensions/render_alphabetsoup.py 2012-10-07 07:47:16 +0000 @@ -18,22 +18,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - +# standard library import copy -import inkex -import simplestyle import math import cmath import string import random +import os +import sys +import re +# local library +import inkex +import simplestyle import render_alphabetsoup_config import bezmisc import simplepath -import os -import sys -import re -import gettext -_ = gettext.gettext + +inkex.localize() syntax = render_alphabetsoup_config.syntax alphabet = render_alphabetsoup_config.alphabet === modified file 'share/extensions/render_barcode_datamatrix.py' --- share/extensions/render_barcode_datamatrix.py 2011-11-21 20:58:06 +0000 +++ share/extensions/render_barcode_datamatrix.py 2012-10-07 07:47:16 +0000 @@ -51,11 +51,11 @@ 0.50 2009-10-25 Full functionality, up to 144x144. ASCII and compressed digit encoding only. ''' - -import inkex, simplestyle - -import gettext -_ = gettext.gettext +# local library +import inkex +import simplestyle + +inkex.localize() symbols = { 'sq10': (10, 10), === modified file 'share/extensions/replace_font.py' --- share/extensions/replace_font.py 2011-11-21 20:58:06 +0000 +++ share/extensions/replace_font.py 2012-10-07 07:47:16 +0000 @@ -27,13 +27,14 @@ It can also replace all fonts indiscriminately, and list all fonts currently being used. ''' - +# standard library import os import sys +# local library import inkex import simplestyle -import gettext -_ = gettext.gettext + +inkex.localize() text_tags = ['{http://www.w3.org/2000/svg}tspan', '{http://www.w3.org/2000/svg}text', === modified file 'share/extensions/summersnight.py' --- share/extensions/summersnight.py 2012-02-09 05:25:41 +0000 +++ share/extensions/summersnight.py 2012-10-07 07:47:16 +0000 @@ -17,18 +17,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -import gettext +# standard library import os - +# local library import cubicsuperpath import inkex import simplepath import simpletransform import voronoi2svg - from ffgeom import * -_ = gettext.gettext +inkex.localize() try: from subprocess import Popen, PIPE === modified file 'share/extensions/svg_and_media_zip_output.py' --- share/extensions/svg_and_media_zip_output.py 2011-11-21 20:58:06 +0000 +++ share/extensions/svg_and_media_zip_output.py 2012-10-07 07:47:16 +0000 @@ -36,8 +36,7 @@ - maybe add better extention - consider switching to lzma in order to allow cross platform compression with no encoding problem... ''' - -import inkex +# standard library import urlparse import urllib import os, os.path @@ -46,11 +45,13 @@ import shutil import sys import tempfile +import locale +# local library +import inkex import simplestyle -import gettext -import locale + locale.setlocale(locale.LC_ALL, '') -_ = gettext.gettext +inkex.localize() class CompressedMediaOutput(inkex.Effect): def __init__(self): === modified file 'share/extensions/uniconv-ext.py' --- share/extensions/uniconv-ext.py 2011-11-21 20:58:06 +0000 +++ share/extensions/uniconv-ext.py 2012-10-07 07:47:16 +0000 @@ -20,14 +20,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ - +# standard library import sys -from run_command import run -import gettext -_ = gettext.gettext - -cmd = None - try: from subprocess import Popen, PIPE p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait() @@ -43,6 +37,13 @@ if p!=32512 : cmd = 'uniconv' p = Popen3('uniconvertor', True).wait() if p!=32512 : cmd = 'uniconvertor' +# local library +from run_command import run +import inkex + +cmd = None + +inkex.localize() if cmd == None: # there's no succeffully-returning uniconv command; try to get the module directly (on Windows) === modified file 'share/extensions/uniconv_output.py' --- share/extensions/uniconv_output.py 2011-11-21 20:58:06 +0000 +++ share/extensions/uniconv_output.py 2012-10-07 07:47:16 +0000 @@ -28,11 +28,13 @@ # On failure, outputs an error message to stderr, and exits with a return # code of 1. +# standard library import os import sys import tempfile -import gettext -_ = gettext.gettext +# local library +import inkex +inkex.localize() def run(command_format, prog_name, uniconv_format): outfile = tempfile.mktemp(uniconv_format) === modified file 'share/extensions/voronoi2svg.py' --- share/extensions/voronoi2svg.py 2011-11-21 20:58:06 +0000 +++ share/extensions/voronoi2svg.py 2012-10-07 07:47:16 +0000 @@ -27,11 +27,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -import sys, os -import inkex, simplestyle, simplepath, simpletransform +# standard library +import sys +import os +# local library +import inkex +import simplestyle +import simplepath +import simpletransform import voronoi -import gettext -_ = gettext.gettext + +inkex.localize() class Point: def __init__(self,x,y): === modified file 'share/extensions/web-set-att.py' --- share/extensions/web-set-att.py 2010-09-09 18:59:23 +0000 +++ share/extensions/web-set-att.py 2012-10-07 07:47:16 +0000 @@ -16,9 +16,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkwebeffect, gettext +# local library +import inkwebeffect +import inkex -_ = gettext.gettext +inkex.localize() class InkWebTransmitAtt(inkwebeffect.InkWebEffect): === modified file 'share/extensions/web-transmit-att.py' --- share/extensions/web-transmit-att.py 2011-11-21 20:58:06 +0000 +++ share/extensions/web-transmit-att.py 2012-10-07 07:47:16 +0000 @@ -16,9 +16,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkwebeffect, gettext +# local library +import inkwebeffect +import inkex -_ = gettext.gettext +inkex.localize() class InkWebTransmitAtt(inkwebeffect.InkWebEffect): === modified file 'share/extensions/webslicer_create_group.py' --- share/extensions/webslicer_create_group.py 2011-11-21 20:58:06 +0000 +++ share/extensions/webslicer_create_group.py 2012-10-07 07:47:16 +0000 @@ -16,12 +16,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - +# local library from webslicer_effect import * import inkex -import gettext -_ = gettext.gettext +inkex.localize() class WebSlicer_CreateGroup(WebSlicer_Effect): === modified file 'share/extensions/webslicer_create_rect.py' --- share/extensions/webslicer_create_rect.py 2010-04-26 04:45:48 +0000 +++ share/extensions/webslicer_create_rect.py 2012-10-07 07:47:16 +0000 @@ -16,12 +16,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - +# local library from webslicer_effect import * import inkex -import gettext -_ = gettext.gettext +inkex.localize() class WebSlicer_CreateRect(WebSlicer_Effect): === modified file 'share/extensions/webslicer_export.py' --- share/extensions/webslicer_export.py 2011-08-30 20:14:06 +0000 +++ share/extensions/webslicer_export.py 2012-10-07 07:47:16 +0000 @@ -16,15 +16,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' - -from webslicer_effect import * -import inkex -import gettext +# standard library import os import sys import tempfile +# local library +from webslicer_effect import * +import inkex -_ = gettext.gettext +inkex.localize() class WebSlicer_Export(WebSlicer_Effect): === modified file 'share/extensions/wireframe_sphere.py' --- share/extensions/wireframe_sphere.py 2011-11-21 20:58:06 +0000 +++ share/extensions/wireframe_sphere.py 2012-10-07 07:47:16 +0000 @@ -54,13 +54,13 @@ Hidden lines of latitude still not properly calculated. Prolate and oblate spheroids not considered. ''' - -import inkex, simplestyle - -import gettext -_ = gettext.gettext - +# standard library from math import * +# local library +import inkex +import simplestyle + +inkex.localize() #SVG OUTPUT FUNCTIONS ================================================ def draw_SVG_ellipse((rx, ry), (cx, cy), parent, start_end=(0,2*pi),transform='' ): === modified file 'src/main.cpp' --- src/main.cpp 2012-10-04 01:45:44 +0000 +++ src/main.cpp 2012-10-07 12:25:02 +0000 @@ -625,6 +625,8 @@ bindtextdomain(GETTEXT_PACKAGE, BR_LOCALEDIR("")); # else bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + // needed by Python/Gettext + g_setenv("PACKAGE_LOCALE_DIR", PACKAGE_LOCALE_DIR, TRUE); # endif #endif