diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2017-01-25 09:46:27 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2017-01-25 09:46:27 +0000 |
| commit | 59ed5cf5fae750ea136fe8f5a37df23b541f80d5 (patch) | |
| tree | 08fd8c0ac7d70c22fe8e2c1edc960235e2710010 /share/extensions | |
| parent | Update to trunk (diff) | |
| parent | Comented one of the shortcuts for doc rotate because bad response now interac... (diff) | |
| download | inkscape-59ed5cf5fae750ea136fe8f5a37df23b541f80d5.tar.gz inkscape-59ed5cf5fae750ea136fe8f5a37df23b541f80d5.zip | |
update to trunk
(bzr r13645.1.168)
Diffstat (limited to 'share/extensions')
| -rwxr-xr-x | share/extensions/dxf_outlines.py | 2 | ||||
| -rwxr-xr-x | share/extensions/hpgl_output.py | 15 | ||||
| -rwxr-xr-x | share/extensions/measure.py | 3 | ||||
| -rwxr-xr-x | share/extensions/perspective.py | 2 | ||||
| -rwxr-xr-x | share/extensions/polyhedron_3d.py | 3 | ||||
| -rwxr-xr-x | share/extensions/synfig_output.py | 9 | ||||
| -rwxr-xr-x | share/extensions/test/run-all-extension-tests | 27 | ||||
| -rwxr-xr-x | share/extensions/uniconv-ext.py | 2 | ||||
| -rwxr-xr-x | share/extensions/uniconv_output.py | 2 |
9 files changed, 52 insertions, 13 deletions
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py index 525461bde..a387df4a1 100755 --- a/share/extensions/dxf_outlines.py +++ b/share/extensions/dxf_outlines.py @@ -44,6 +44,8 @@ try: from numpy import * from numpy.linalg import solve except: + # Initialize gettext for messages outside an inkex derived class + inkex.localize() inkex.errormsg(_("Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again.")) inkex.sys.exit() diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index 58f82da71..f31c3fc2d 100755 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # standard library import sys +from inkex import NSS # local libraries import hpgl_encoder import inkex @@ -44,10 +45,18 @@ class HpglOutput(inkex.Effect): self.OptionParser.add_option('--precut', action='store', type='inkbool', dest='precut', default='TRUE', help='Use precut') self.OptionParser.add_option('--flat', action='store', type='float', dest='flat', default=1.2, help='Curve flatness') self.OptionParser.add_option('--autoAlign', action='store', type='inkbool', dest='autoAlign', default='TRUE', help='Auto align') + self.DOCROTATE = "{http://www.inkscape.org/namespaces/inkscape}document_rotation" def effect(self): self.options.debug = False # get hpgl data + svg = self.document.getroot() + xpathStr = '//sodipodi:namedview' + nv = svg.xpath(xpathStr, namespaces=NSS) + document_rotate = "0" + if nv != []: + document_rotate = nv[0].get(self.DOCROTATE) + nv[0].set(self.DOCROTATE,"0") myHpglEncoder = hpgl_encoder.hpglEncoder(self) try: self.hpgl, debugObject = myHpglEncoder.getHpgl() @@ -56,9 +65,13 @@ class HpglOutput(inkex.Effect): # issue error if no paths found inkex.errormsg(_("No paths where found. Please convert all objects you want to save into paths.")) self.hpgl = '' + if nv != [] and document_rotate: + nv[0].set("inkscape:document_rotation",document_rotate) return else: type, value, traceback = sys.exc_info() + if nv != [] and document_rotate: + nv[0].set("inkscape:document_rotation",document_rotate) raise ValueError, ("", type, value), traceback # convert raw HPGL to HPGL hpglInit = 'IN' @@ -67,6 +80,8 @@ class HpglOutput(inkex.Effect): if self.options.speed > 0: hpglInit += ';VS%d' % self.options.speed self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; ' + if nv != [] and document_rotate: + nv[0].set("inkscape:document_rotation",document_rotate) def output(self): # print to file diff --git a/share/extensions/measure.py b/share/extensions/measure.py index b605ffe93..d025f142c 100755 --- a/share/extensions/measure.py +++ b/share/extensions/measure.py @@ -51,6 +51,9 @@ try: except locale.Error: locale.setlocale(locale.LC_ALL, 'C') +# Initialize gettext for messages outside an inkex derived class +inkex.localize() + # third party try: import numpy diff --git a/share/extensions/perspective.py b/share/extensions/perspective.py index ea08b98dc..f15deaad5 100755 --- a/share/extensions/perspective.py +++ b/share/extensions/perspective.py @@ -39,6 +39,8 @@ try: from numpy import * from numpy.linalg import * except: + # Initialize gettext for messages outside an inkex derived class + inkex.localize() 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() diff --git a/share/extensions/polyhedron_3d.py b/share/extensions/polyhedron_3d.py index 86203d4bc..a74a64e69 100755 --- a/share/extensions/polyhedron_3d.py +++ b/share/extensions/polyhedron_3d.py @@ -57,6 +57,9 @@ import inkex import simplestyle from simpletransform import computePointInNode +# Initialize gettext for messages outside an inkex derived class +inkex.localize() + # third party try: from numpy import * diff --git a/share/extensions/synfig_output.py b/share/extensions/synfig_output.py index bcd1eeaf3..461078951 100755 --- a/share/extensions/synfig_output.py +++ b/share/extensions/synfig_output.py @@ -1046,6 +1046,11 @@ def extract_width(style, width_attrib, mtx): ###### Main Class ######################################### class SynfigExport(SynfigPrep): def __init__(self): + svg = self.document.getroot() + xpathStr = '//http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}:namedview' + res = svg.xpath(xpathStr, namespaces=inkex.NSS) + self.document_rotate = res[0].get("inkscape:document_rotation") + res[0].set("inkscape:document_rotation","0") SynfigPrep.__init__(self) def effect(self): @@ -1073,6 +1078,10 @@ class SynfigExport(SynfigPrep): root_canvas.append(layer) d.get_root_tree().write(sys.stdout) + svg = self.document.getroot() + xpathStr = '//http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}:namedview' + res = svg.xpath(xpathStr, namespaces=inkex.NSS) + res[0].set("inkscape:document_rotation",self.document_rotate) def convert_node(self, node, d): """Convert an SVG node to a list of Synfig layers""" diff --git a/share/extensions/test/run-all-extension-tests b/share/extensions/test/run-all-extension-tests index e7faf672a..ff739c311 100755 --- a/share/extensions/test/run-all-extension-tests +++ b/share/extensions/test/run-all-extension-tests @@ -38,20 +38,25 @@ failed_tests=$( $MKTEMP ) if coverage.py erase >/dev/null 2>/dev/null; then has_py_coverage=true cover_py_cmd=coverage.py -else - if coverage erase >/dev/null 2>/dev/null; then - has_py_coverage=true - cover_py_cmd=coverage - else - if python-coverage erase >/dev/null 2>/dev/null; then - has_py_coverage=true - cover_py_cmd=python-coverage - fi - fi + else + if coverage erase >/dev/null 2>/dev/null; then + has_py_coverage=true + cover_py_cmd=coverage + else + if python-coverage erase >/dev/null 2>/dev/null; then + has_py_coverage=true + cover_py_cmd=python-coverage + else + if coverage-script.py erase >/dev/null 2>/dev/null; then + has_py_coverage=true + cover_py_cmd=coverage-script.py + fi + fi + fi fi if $has_py_coverage; then - echo -e "\nRunning tests with coverage" + echo -e "\nRunning tests with coverage (${cover_py_cmd})" fi #if $has_py_coverage; then # $cover_py_cmd -e diff --git a/share/extensions/uniconv-ext.py b/share/extensions/uniconv-ext.py index 6ce0d7fab..876cc4642 100755 --- a/share/extensions/uniconv-ext.py +++ b/share/extensions/uniconv-ext.py @@ -55,7 +55,7 @@ if cmd == None: inkex.errormsg(_('You need to install the UniConvertor software.\n'+\ 'For GNU/Linux: install the package python-uniconvertor.\n'+\ 'For Windows: download it from\n'+\ - 'http://sk1project.org/modules.php?name=Products&product=uniconvertor\n'+\ + 'https://sk1project.net/modules.php?name=Products&product=uniconvertor&op=download\n'+\ 'and install into your Inkscape\'s Python location\n')) sys.exit(1) cmd = 'python -c "import uniconvertor; uniconvertor.uniconv_run()"' diff --git a/share/extensions/uniconv_output.py b/share/extensions/uniconv_output.py index a02a16d95..de6b6409f 100755 --- a/share/extensions/uniconv_output.py +++ b/share/extensions/uniconv_output.py @@ -122,7 +122,7 @@ def get_command(): inkex.errormsg(_('You need to install the UniConvertor software.\n'+\ 'For GNU/Linux: install the package python-uniconvertor.\n'+\ 'For Windows: download it from\n'+\ - 'http://sk1project.org/modules.php?name=Products&product=uniconvertor\n'+\ + 'https://sk1project.net/modules.php?name=Products&product=uniconvertor&op=download\n'+\ 'and install into your Inkscape\'s Python location\n')) sys.exit(1) cmd = 'python -c "import uniconvertor; uniconvertor.uniconv_run();"' |
