summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'share/extensions')
-rw-r--r--share/extensions/Barcode/Base.py2
-rw-r--r--share/extensions/Barcode/BaseEan.py2
-rw-r--r--share/extensions/Barcode/Code128.py2
-rw-r--r--share/extensions/Barcode/Code25i.py2
-rw-r--r--share/extensions/Barcode/Code39.py2
-rw-r--r--share/extensions/Barcode/Code39Ext.py2
-rw-r--r--share/extensions/Barcode/Code93.py2
-rw-r--r--share/extensions/Barcode/Ean13.py2
-rw-r--r--share/extensions/Barcode/Ean5.py2
-rw-r--r--share/extensions/Barcode/Ean8.py2
-rw-r--r--share/extensions/Barcode/Rm4scc.py2
-rw-r--r--share/extensions/Barcode/Upca.py2
-rw-r--r--share/extensions/Barcode/Upce.py2
-rw-r--r--share/extensions/Barcode/__init__.py2
-rwxr-xr-xshare/extensions/addnodes.py2
-rwxr-xr-xshare/extensions/bezmisc.py2
-rwxr-xr-xshare/extensions/chardataeffect.py2
-rwxr-xr-xshare/extensions/coloreffect.py2
-rwxr-xr-xshare/extensions/convert2dashes.py2
-rwxr-xr-xshare/extensions/cubicsuperpath.py2
-rwxr-xr-xshare/extensions/dimension.py2
-rwxr-xr-xshare/extensions/dm2svg.py2
-rwxr-xr-xshare/extensions/dots.py2
-rwxr-xr-xshare/extensions/draw_from_triangle.py2
-rwxr-xr-xshare/extensions/dxf_input.py2
-rwxr-xr-xshare/extensions/dxf_outlines.py2
-rwxr-xr-xshare/extensions/edge3d.py2
-rwxr-xr-xshare/extensions/embedimage.py2
-rwxr-xr-xshare/extensions/extractimage.py2
-rwxr-xr-xshare/extensions/extrude.py2
-rwxr-xr-xshare/extensions/ffgeom.py2
-rwxr-xr-xshare/extensions/flatten.py2
-rwxr-xr-xshare/extensions/foldablebox.py2
-rwxr-xr-xshare/extensions/fractalize.py2
-rwxr-xr-xshare/extensions/funcplot.py2
-rwxr-xr-xshare/extensions/gcodetools.py2
-rwxr-xr-xshare/extensions/generate_voronoi.py2
-rwxr-xr-xshare/extensions/gimp_xcf.py2
-rwxr-xr-xshare/extensions/grid_cartesian.py2
-rwxr-xr-xshare/extensions/grid_isometric.py2
-rwxr-xr-xshare/extensions/grid_polar.py2
-rwxr-xr-xshare/extensions/guides_creator.py2
-rwxr-xr-xshare/extensions/handles.py2
-rwxr-xr-xshare/extensions/hershey.py2
-rw-r--r--share/extensions/hpgl_decoder.py2
-rw-r--r--share/extensions/hpgl_encoder.py2
-rwxr-xr-xshare/extensions/hpgl_input.py2
-rwxr-xr-xshare/extensions/hpgl_output.py2
-rwxr-xr-xshare/extensions/image_attributes.py2
-rwxr-xr-xshare/extensions/ink2canvas.py2
-rw-r--r--share/extensions/ink2canvas/canvas.py2
-rw-r--r--share/extensions/ink2canvas/svg.py2
-rwxr-xr-xshare/extensions/inkex.py135
-rwxr-xr-xshare/extensions/inkwebeffect.py2
-rwxr-xr-xshare/extensions/interp.py2
-rwxr-xr-xshare/extensions/interp_att_g.py2
-rwxr-xr-xshare/extensions/layers2svgfont.py2
-rwxr-xr-xshare/extensions/layout_nup.py2
-rwxr-xr-xshare/extensions/lindenmayer.py2
-rwxr-xr-xshare/extensions/lorem_ipsum.py2
-rwxr-xr-xshare/extensions/markers_strokepaint.py2
-rwxr-xr-xshare/extensions/measure.py2
-rwxr-xr-xshare/extensions/merge_styles.py2
-rwxr-xr-xshare/extensions/motion.py2
-rwxr-xr-xshare/extensions/new_glyph_layer.py11
-rwxr-xr-xshare/extensions/next_glyph_layer.py2
-rwxr-xr-xshare/extensions/param_curves.py2
-rwxr-xr-xshare/extensions/pathalongpath.py2
-rwxr-xr-xshare/extensions/pathmodifier.py2
-rwxr-xr-xshare/extensions/pathscatter.py2
-rwxr-xr-xshare/extensions/perfectboundcover.py2
-rwxr-xr-xshare/extensions/perspective.py2
-rwxr-xr-xshare/extensions/plotter.py2
-rwxr-xr-xshare/extensions/polyhedron_3d.py2
-rwxr-xr-xshare/extensions/previous_glyph_layer.py2
-rwxr-xr-xshare/extensions/print_win32_vector.py2
-rwxr-xr-xshare/extensions/printing_marks.py2
-rwxr-xr-xshare/extensions/pturtle.py2
-rwxr-xr-xshare/extensions/radiusrand.py2
-rwxr-xr-xshare/extensions/render_alphabetsoup.py2
-rwxr-xr-xshare/extensions/render_barcode.py2
-rwxr-xr-xshare/extensions/render_barcode_datamatrix.py2
-rwxr-xr-xshare/extensions/render_gear_rack.py2
-rwxr-xr-xshare/extensions/render_gears.py2
-rwxr-xr-xshare/extensions/rtree.py2
-rwxr-xr-xshare/extensions/rubberstretch.py2
-rwxr-xr-xshare/extensions/setup_typography_canvas.py2
-rw-r--r--share/extensions/simplepath.py2
-rw-r--r--share/extensions/simplestyle.py2
-rw-r--r--share/extensions/simpletransform.py2
-rwxr-xr-xshare/extensions/spirograph.py2
-rwxr-xr-xshare/extensions/split.py2
-rwxr-xr-xshare/extensions/straightseg.py2
-rwxr-xr-xshare/extensions/summersnight.py2
-rwxr-xr-xshare/extensions/svg_and_media_zip_output.py2
-rwxr-xr-xshare/extensions/svgcalendar.py2
-rwxr-xr-xshare/extensions/svgfont2layers.py2
-rwxr-xr-xshare/extensions/tar_layers.py2
-rwxr-xr-xshare/extensions/triangle.py2
-rw-r--r--[-rwxr-xr-x]share/extensions/voronoi.py2
-rw-r--r--share/extensions/voronoi2svg.inx6
-rw-r--r--[-rwxr-xr-x]share/extensions/voronoi2svg.py59
-rwxr-xr-xshare/extensions/web-set-att.py2
-rwxr-xr-xshare/extensions/web-transmit-att.py2
-rwxr-xr-xshare/extensions/webslicer_create_group.py2
-rwxr-xr-xshare/extensions/webslicer_create_rect.py2
-rwxr-xr-xshare/extensions/webslicer_effect.py2
-rwxr-xr-xshare/extensions/webslicer_export.py2
-rwxr-xr-xshare/extensions/whirl.py2
-rwxr-xr-xshare/extensions/wireframe_sphere.py2
110 files changed, 246 insertions, 177 deletions
diff --git a/share/extensions/Barcode/Base.py b/share/extensions/Barcode/Base.py
index b7429f84f..1aa1f8415 100644
--- a/share/extensions/Barcode/Base.py
+++ b/share/extensions/Barcode/Base.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Base module for rendering barcodes for Inkscape.
diff --git a/share/extensions/Barcode/BaseEan.py b/share/extensions/Barcode/BaseEan.py
index 05c9b1c39..4ceaeed4a 100644
--- a/share/extensions/Barcode/BaseEan.py
+++ b/share/extensions/Barcode/BaseEan.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Some basic common code shared between EAN and UCP generators.
diff --git a/share/extensions/Barcode/Code128.py b/share/extensions/Barcode/Code128.py
index 618ce7817..7ff92088f 100644
--- a/share/extensions/Barcode/Code128.py
+++ b/share/extensions/Barcode/Code128.py
@@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for Code128/EAN128 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Code25i.py b/share/extensions/Barcode/Code25i.py
index 51346be60..9812d8598 100644
--- a/share/extensions/Barcode/Code25i.py
+++ b/share/extensions/Barcode/Code25i.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Generate barcodes for Code25-interleaved 2 of 5, for Inkscape.
diff --git a/share/extensions/Barcode/Code39.py b/share/extensions/Barcode/Code39.py
index ade397463..3cd8467a8 100644
--- a/share/extensions/Barcode/Code39.py
+++ b/share/extensions/Barcode/Code39.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for Code39 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Code39Ext.py b/share/extensions/Barcode/Code39Ext.py
index b6df47de2..3edf82d2e 100644
--- a/share/extensions/Barcode/Code39Ext.py
+++ b/share/extensions/Barcode/Code39Ext.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for Code39 Extended barcodes. Designed for Inkscape.
diff --git a/share/extensions/Barcode/Code93.py b/share/extensions/Barcode/Code93.py
index 866ec6036..2b90fdda1 100644
--- a/share/extensions/Barcode/Code93.py
+++ b/share/extensions/Barcode/Code93.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for Code93 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Ean13.py b/share/extensions/Barcode/Ean13.py
index 3bad5d6e5..7e138f25a 100644
--- a/share/extensions/Barcode/Ean13.py
+++ b/share/extensions/Barcode/Ean13.py
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for EAN13 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Ean5.py b/share/extensions/Barcode/Ean5.py
index 1bd26a4bd..d2e38a063 100644
--- a/share/extensions/Barcode/Ean5.py
+++ b/share/extensions/Barcode/Ean5.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for EAN5 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Ean8.py b/share/extensions/Barcode/Ean8.py
index 83e82814a..010dff03e 100644
--- a/share/extensions/Barcode/Ean8.py
+++ b/share/extensions/Barcode/Ean8.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for EAN8 barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Rm4scc.py b/share/extensions/Barcode/Rm4scc.py
index 0fb154280..d40cd2435 100644
--- a/share/extensions/Barcode/Rm4scc.py
+++ b/share/extensions/Barcode/Rm4scc.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for RM4CC barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Upca.py b/share/extensions/Barcode/Upca.py
index d69ed11e6..bc6ffdf29 100644
--- a/share/extensions/Barcode/Upca.py
+++ b/share/extensions/Barcode/Upca.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for UPCA barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/Upce.py b/share/extensions/Barcode/Upce.py
index eee2a739c..d25c9c6cc 100644
--- a/share/extensions/Barcode/Upce.py
+++ b/share/extensions/Barcode/Upce.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Python barcode renderer for UPCE barcodes. Designed for use with Inkscape.
diff --git a/share/extensions/Barcode/__init__.py b/share/extensions/Barcode/__init__.py
index e4e328ae3..9ad412448 100644
--- a/share/extensions/Barcode/__init__.py
+++ b/share/extensions/Barcode/__init__.py
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Renderer for barcodes, SVG extention for Inkscape.
diff --git a/share/extensions/addnodes.py b/share/extensions/addnodes.py
index d78ab55e7..4e57f0185 100755
--- a/share/extensions/addnodes.py
+++ b/share/extensions/addnodes.py
@@ -19,7 +19,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/bezmisc.py b/share/extensions/bezmisc.py
index 0c7ad4957..c36e8e1b4 100755
--- a/share/extensions/bezmisc.py
+++ b/share/extensions/bezmisc.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import math, cmath
diff --git a/share/extensions/chardataeffect.py b/share/extensions/chardataeffect.py
index a1758c890..f81de6b80 100755
--- a/share/extensions/chardataeffect.py
+++ b/share/extensions/chardataeffect.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import sys, optparse, inkex
diff --git a/share/extensions/coloreffect.py b/share/extensions/coloreffect.py
index 8f67c6090..a6b5cfe41 100755
--- a/share/extensions/coloreffect.py
+++ b/share/extensions/coloreffect.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import sys, copy, simplestyle, inkex
import random
diff --git a/share/extensions/convert2dashes.py b/share/extensions/convert2dashes.py
index 1228b247c..3910d8e82 100755
--- a/share/extensions/convert2dashes.py
+++ b/share/extensions/convert2dashes.py
@@ -18,7 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
import inkex
diff --git a/share/extensions/cubicsuperpath.py b/share/extensions/cubicsuperpath.py
index 925efdb04..b505e8c4f 100755
--- a/share/extensions/cubicsuperpath.py
+++ b/share/extensions/cubicsuperpath.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
import simplepath
diff --git a/share/extensions/dimension.py b/share/extensions/dimension.py
index 30b674201..462a05bae 100755
--- a/share/extensions/dimension.py
+++ b/share/extensions/dimension.py
@@ -29,7 +29,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
diff --git a/share/extensions/dm2svg.py b/share/extensions/dm2svg.py
index 908fedbad..74afe6adf 100755
--- a/share/extensions/dm2svg.py
+++ b/share/extensions/dm2svg.py
@@ -18,7 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import struct
diff --git a/share/extensions/dots.py b/share/extensions/dots.py
index dc533ffb6..296a56dfc 100755
--- a/share/extensions/dots.py
+++ b/share/extensions/dots.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplestyle, simplepath, math
diff --git a/share/extensions/draw_from_triangle.py b/share/extensions/draw_from_triangle.py
index 42cda7035..5efabfbba 100755
--- a/share/extensions/draw_from_triangle.py
+++ b/share/extensions/draw_from_triangle.py
@@ -28,7 +28,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import sys
diff --git a/share/extensions/dxf_input.py b/share/extensions/dxf_input.py
index acfed0921..30adb73f9 100755
--- a/share/extensions/dxf_input.py
+++ b/share/extensions/dxf_input.py
@@ -19,7 +19,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplestyle, math
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index b7ae0ef14..0e8cb7f62 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -28,7 +28,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import math
diff --git a/share/extensions/edge3d.py b/share/extensions/edge3d.py
index d2d8ead5c..86df52908 100755
--- a/share/extensions/edge3d.py
+++ b/share/extensions/edge3d.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplepath, sys, copy
from math import degrees, atan2
diff --git a/share/extensions/embedimage.py b/share/extensions/embedimage.py
index bdc15bde2..136c20f98 100755
--- a/share/extensions/embedimage.py
+++ b/share/extensions/embedimage.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import base64
diff --git a/share/extensions/extractimage.py b/share/extensions/extractimage.py
index 62dc83c87..aae7bd062 100755
--- a/share/extensions/extractimage.py
+++ b/share/extensions/extractimage.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import base64
diff --git a/share/extensions/extrude.py b/share/extensions/extrude.py
index c91ea645e..8db6b1512 100755
--- a/share/extensions/extrude.py
+++ b/share/extensions/extrude.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
import inkex
diff --git a/share/extensions/ffgeom.py b/share/extensions/ffgeom.py
index ef8799b97..a6d268239 100755
--- a/share/extensions/ffgeom.py
+++ b/share/extensions/ffgeom.py
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with FretFind 2-D; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
import math
try:
diff --git a/share/extensions/flatten.py b/share/extensions/flatten.py
index f5add5fc5..7b4d2a7d6 100755
--- a/share/extensions/flatten.py
+++ b/share/extensions/flatten.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, cubicsuperpath, simplepath, cspsubdiv
diff --git a/share/extensions/foldablebox.py b/share/extensions/foldablebox.py
index 9d58974c5..772083094 100755
--- a/share/extensions/foldablebox.py
+++ b/share/extensions/foldablebox.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
__version__ = "0.2"
diff --git a/share/extensions/fractalize.py b/share/extensions/fractalize.py
index 901a8f761..c6bbe397a 100755
--- a/share/extensions/fractalize.py
+++ b/share/extensions/fractalize.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import random, math, inkex, simplepath
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py
index f37bf335e..c0fb3e525 100755
--- a/share/extensions/funcplot.py
+++ b/share/extensions/funcplot.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Changes:
* This program is a modified version of wavy.py by Aaron Spike.
diff --git a/share/extensions/gcodetools.py b/share/extensions/gcodetools.py
index 12f438cca..4cb5b2696 100755
--- a/share/extensions/gcodetools.py
+++ b/share/extensions/gcodetools.py
@@ -59,7 +59,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
###
diff --git a/share/extensions/generate_voronoi.py b/share/extensions/generate_voronoi.py
index 7acd1be5f..8907db493 100755
--- a/share/extensions/generate_voronoi.py
+++ b/share/extensions/generate_voronoi.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
# standard library
diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py
index bdb0d1e4c..39dec8c13 100755
--- a/share/extensions/gimp_xcf.py
+++ b/share/extensions/gimp_xcf.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import os
diff --git a/share/extensions/grid_cartesian.py b/share/extensions/grid_cartesian.py
index ae4c6b6b4..26270002d 100755
--- a/share/extensions/grid_cartesian.py
+++ b/share/extensions/grid_cartesian.py
@@ -19,7 +19,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/grid_isometric.py b/share/extensions/grid_isometric.py
index 6202fd9e2..d80be6c4d 100755
--- a/share/extensions/grid_isometric.py
+++ b/share/extensions/grid_isometric.py
@@ -20,7 +20,7 @@
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
-#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkex
diff --git a/share/extensions/grid_polar.py b/share/extensions/grid_polar.py
index 350b21195..f3d5dbf41 100755
--- a/share/extensions/grid_polar.py
+++ b/share/extensions/grid_polar.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/guides_creator.py b/share/extensions/guides_creator.py
index a8c7bb18a..e0aa6cadf 100755
--- a/share/extensions/guides_creator.py
+++ b/share/extensions/guides_creator.py
@@ -25,7 +25,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# Inspired by hello_world turorial by Blackhex and Rubikcube
diff --git a/share/extensions/handles.py b/share/extensions/handles.py
index 0cbdef44c..6987a3bb2 100755
--- a/share/extensions/handles.py
+++ b/share/extensions/handles.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplepath, simplestyle
diff --git a/share/extensions/hershey.py b/share/extensions/hershey.py
index d0b27b129..471959b10 100755
--- a/share/extensions/hershey.py
+++ b/share/extensions/hershey.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
import hersheydata #data file w/ Hershey font data
import inkex
diff --git a/share/extensions/hpgl_decoder.py b/share/extensions/hpgl_decoder.py
index a54a81e81..8f3c18e42 100644
--- a/share/extensions/hpgl_decoder.py
+++ b/share/extensions/hpgl_decoder.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard libraries
diff --git a/share/extensions/hpgl_encoder.py b/share/extensions/hpgl_encoder.py
index 0e4158725..b9975215f 100644
--- a/share/extensions/hpgl_encoder.py
+++ b/share/extensions/hpgl_encoder.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard libraries
diff --git a/share/extensions/hpgl_input.py b/share/extensions/hpgl_input.py
index a85c32b34..8cc7edaaf 100755
--- a/share/extensions/hpgl_input.py
+++ b/share/extensions/hpgl_input.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard libraries
diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py
index 78edba53b..477db40e7 100755
--- a/share/extensions/hpgl_output.py
+++ b/share/extensions/hpgl_output.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
diff --git a/share/extensions/image_attributes.py b/share/extensions/image_attributes.py
index ddd5a8b87..80ad62c26 100755
--- a/share/extensions/image_attributes.py
+++ b/share/extensions/image_attributes.py
@@ -21,7 +21,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
diff --git a/share/extensions/ink2canvas.py b/share/extensions/ink2canvas.py
index b5c0fbb7b..f44c3e48f 100755
--- a/share/extensions/ink2canvas.py
+++ b/share/extensions/ink2canvas.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/ink2canvas/canvas.py b/share/extensions/ink2canvas/canvas.py
index 139835f0e..a88d368d3 100644
--- a/share/extensions/ink2canvas/canvas.py
+++ b/share/extensions/ink2canvas/canvas.py
@@ -13,7 +13,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/ink2canvas/svg.py b/share/extensions/ink2canvas/svg.py
index b60b2ca9f..f4dca8279 100644
--- a/share/extensions/ink2canvas/svg.py
+++ b/share/extensions/ink2canvas/svg.py
@@ -13,7 +13,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index 0fdaeea75..264ae0ff4 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -24,7 +24,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
import copy
import gettext
@@ -35,7 +35,7 @@ import re
import sys
from math import *
-#a dictionary of all of the xmlns prefixes in a standard inkscape doc
+# 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',
u'cc' :u'http://creativecommons.org/ns#',
@@ -48,6 +48,7 @@ u'xlink' :u'http://www.w3.org/1999/xlink',
u'xml' :u'http://www.w3.org/XML/1998/namespace'
}
+
def localize():
domain = 'inkscape'
if sys.platform.startswith('win'):
@@ -55,33 +56,35 @@ def localize():
current_locale, encoding = locale.getdefaultlocale()
os.environ['LANG'] = current_locale
try:
- localdir = os.environ['INKSCAPE_LOCALEDIR'];
+ localdir = os.environ['INKSCAPE_LOCALEDIR']
trans = gettext.translation(domain, localdir, [current_locale], fallback=True)
except KeyError:
trans = gettext.translation(domain, fallback=True)
elif sys.platform.startswith('darwin'):
try:
- localdir = os.environ['INKSCAPE_LOCALEDIR'];
+ localdir = os.environ['INKSCAPE_LOCALEDIR']
trans = gettext.translation(domain, localdir, fallback=True)
except KeyError:
try:
- localdir = os.environ['PACKAGE_LOCALE_DIR'];
+ localdir = os.environ['PACKAGE_LOCALE_DIR']
trans = gettext.translation(domain, localdir, fallback=True)
except KeyError:
trans = gettext.translation(domain, fallback=True)
else:
try:
- localdir = os.environ['PACKAGE_LOCALE_DIR'];
+ 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()
+
def debug(what):
sys.stderr.write(str(what) + "\n")
return what
+
def errormsg(msg):
"""Intended for end-user-visible error messages.
@@ -97,25 +100,27 @@ def errormsg(msg):
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"))
+
def are_near_relative(a, b, eps):
- if (a-b <= a*eps) and (a-b >= -a*eps):
- return True
- else:
- return False
+ return (a-b <= a*eps) and (a-b >= -a*eps)
# third party library
try:
from lxml import etree
-except Exception, e:
+except ImportError as 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,)))
+ 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
@@ -124,37 +129,45 @@ def check_inkbool(option, opt, value):
else:
raise optparse.OptionValueError("option %s: invalid inkbool value: %s" % (opt, value))
+
def addNS(tag, ns=None):
val = tag
- if ns!=None and len(ns)>0 and NSS.has_key(ns) and len(tag)>0 and tag[0]!='{':
+ if ns is not None and len(ns) > 0 and ns in NSS and len(tag) > 0 and tag[0] != '{':
val = "{%s}%s" % (NSS[ns], tag)
return val
+
class InkOption(optparse.Option):
TYPES = optparse.Option.TYPES + ("inkbool",)
TYPE_CHECKER = copy.copy(optparse.Option.TYPE_CHECKER)
TYPE_CHECKER["inkbool"] = check_inkbool
+
class Effect:
"""A class for creating Inkscape SVG Effects"""
def __init__(self, *args, **kwargs):
- self.document=None
- self.original_document=None
- self.ctx=None
- self.selected={}
- self.doc_ids={}
- self.options=None
- self.args=None
- self.OptionParser = optparse.OptionParser(usage="usage: %prog [options] SVGfile",option_class=InkOption)
+ self.document = None
+ self.original_document = None
+ self.ctx = None
+ self.selected = {}
+ self.doc_ids = {}
+ self.options = None
+ self.args = None
+ self.OptionParser = optparse.OptionParser(usage="usage: %prog [options] SVGfile",
+ option_class=InkOption)
self.OptionParser.add_option("--id",
action="append", type="string", dest="ids", default=[],
help="id attribute of object to manipulate")
self.OptionParser.add_option("--selected-nodes",
action="append", type="string", dest="selected_nodes", default=[],
- help="id:subpath:position of selected nodes, if any")#TODO write a parser for this
+ help="id:subpath:position of selected nodes, if any")
+ # TODO write a parser for this
def effect(self):
+ """Apply some effects on the document. Extensions subclassing Effect
+ must override this function and define the transformations
+ in it."""
pass
def getoptions(self,args=sys.argv[1:]):
@@ -165,19 +178,19 @@ class Effect:
"""Parse document in specified file or on stdin"""
# First try to open the file from the function argument
- if filename != None:
+ if filename is not None:
try:
stream = open(filename, 'r')
- except Exception:
+ except IOError:
errormsg(_("Unable to open specified file: %s") % filename)
sys.exit()
# If it wasn't specified, try to open the file specified as
# an object member
- elif self.svg_file != None:
+ elif self.svg_file is not None:
try:
stream = open(self.svg_file, 'r')
- except Exception:
+ except IOError:
errormsg(_("Unable to open object member file: %s") % self.svg_file)
sys.exit()
@@ -195,7 +208,7 @@ class Effect:
def getposinlayer(self):
#defaults
self.current_layer = self.document.getroot()
- self.view_center = (0.0,0.0)
+ self.view_center = (0.0, 0.0)
layerattr = self.document.xpath('//sodipodi:namedview/@inkscape:current-layer', namespaces=NSS)
if layerattr:
@@ -207,11 +220,12 @@ class Effect:
xattr = self.document.xpath('//sodipodi:namedview/@inkscape:cx', namespaces=NSS)
yattr = self.document.xpath('//sodipodi:namedview/@inkscape:cy', namespaces=NSS)
if xattr and yattr:
- x = self.unittouu( xattr[0] + 'px' )
- y = self.unittouu( yattr[0] + 'px')
+ x = self.unittouu(xattr[0] + 'px')
+ y = self.unittouu(yattr[0] + 'px')
doc_height = self.unittouu(self.getDocumentHeight())
if x and y:
- self.view_center = (float(x), doc_height - float(y)) # FIXME: y-coordinate flip, eliminate it when it's gone in Inkscape
+ self.view_center = (float(x), doc_height - float(y))
+ # FIXME: y-coordinate flip, eliminate it when it's gone in Inkscape
def getselected(self):
"""Collect selected nodes"""
@@ -224,16 +238,14 @@ class Effect:
path = '//*[@id="%s"]' % id
el_list = self.document.xpath(path, namespaces=NSS)
if el_list:
- return el_list[0]
+ return el_list[0]
else:
- return None
+ return None
def getParentNode(self, node):
for parent in self.document.getiterator():
if node in parent.getchildren():
return parent
- break
-
def getdocids(self):
docIdNodes = self.document.xpath('//@id', namespaces=NSS)
@@ -250,7 +262,7 @@ class Effect:
}
guide = etree.SubElement(
self.getNamedView(),
- addNS('guide','sodipodi'), atts )
+ addNS('guide','sodipodi'), atts)
return guide
def output(self):
@@ -269,9 +281,10 @@ class Effect:
self.getselected()
self.getdocids()
self.effect()
- if output: self.output()
+ if output:
+ self.output()
- def uniqueId(self, old_id, make_new_id = True):
+ def uniqueId(self, old_id, make_new_id=True):
new_id = old_id
if make_new_id:
while new_id in self.doc_ids:
@@ -287,9 +300,9 @@ class Effect:
retval = None
return retval
- #a dictionary of unit to user unit conversion factors
- __uuconv = {'in':96.0, 'pt':1.33333333333, 'px':1.0, 'mm':3.77952755913, 'cm':37.7952755913,
- 'm':3779.52755913, 'km':3779527.55913, 'pc':16.0, 'yd':3456.0 , 'ft':1152.0}
+ # a dictionary of unit to user unit conversion factors
+ __uuconv = {'in': 96.0, 'pt': 1.33333333333, 'px': 1.0, 'mm': 3.77952755913, 'cm': 37.7952755913,
+ 'm': 3779.52755913, 'km': 3779527.55913, 'pc': 16.0, 'yd': 3456.0, 'ft': 1152.0}
# Fault tolerance for lazily defined SVG
def getDocumentWidth(self):
@@ -305,6 +318,10 @@ class Effect:
# Fault tolerance for lazily defined SVG
def getDocumentHeight(self):
+ """Returns a string corresponding to the height of the document, as
+ defined in the SVG file. If it is not defined, returns the height
+ as defined by the viewBox attribute. If viewBox is not defined,
+ returns the string '0'."""
height = self.document.getroot().get('height')
if height:
return height
@@ -315,12 +332,13 @@ class Effect:
else:
return '0'
- # Function returns the unit used for the values in SVG.
- # For lack of an attribute in SVG that explicitly defines what units are used for SVG coordinates,
- # try to calculate the unit from the SVG width and SVG viewbox.
- # Defaults to 'px' units.
def getDocumentUnit(self):
- svgunit = 'px' #default to pixels
+ """Returns the unit used for in the SVG document.
+ In the case the SVG document lacks an attribute that explicitly
+ defines what units are used for SVG coordinates, it tries to calculate
+ the unit from the SVG width and viewBox attributes.
+ Defaults to 'px' units."""
+ svgunit = 'px' # default to pixels
svgwidth = self.getDocumentWidth()
viewboxstr = self.document.getroot().get('viewBox')
@@ -331,9 +349,9 @@ class Effect:
p = param.match(svgwidth)
u = unitmatch.search(svgwidth)
- width = 100 #default
- viewboxwidth = 100 #default
- svgwidthunit = 'px' #default assume 'px' unit
+ width = 100 # default
+ viewboxwidth = 100 # default
+ svgwidthunit = 'px' # default assume 'px' unit
if p:
width = float(p.string[p.start():p.end()])
else:
@@ -347,23 +365,22 @@ class Effect:
viewboxnumbers.append(float(t))
except ValueError:
pass
- if len(viewboxnumbers) == 4: #check for correct number of numbers
+ if len(viewboxnumbers) == 4: # check for correct number of numbers
viewboxwidth = viewboxnumbers[2]
svgunitfactor = self.__uuconv[svgwidthunit] * width / viewboxwidth
# try to find the svgunitfactor in the list of units known. If we don't find something, ...
- eps = 0.01 #allow 1% error in factor
+ eps = 0.01 # allow 1% error in factor
for key in self.__uuconv:
if are_near_relative(self.__uuconv[key], svgunitfactor, eps):
- #found match!
- svgunit = key;
+ # found match!
+ svgunit = key
return svgunit
-
def unittouu(self, string):
- '''Returns userunits given a string representation of units in another system'''
+ """Returns userunits given a string representation of units in another system"""
unit = re.compile('(%s)$' % '|'.join(self.__uuconv.keys()))
param = re.compile(r'(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)')
@@ -378,7 +395,7 @@ class Effect:
return retval * (self.__uuconv[u.string[u.start():u.end()]] / self.__uuconv[self.getDocumentUnit()])
except KeyError:
pass
- else: # default assume 'px' unit
+ else: # default assume 'px' unit
return retval / self.__uuconv[self.getDocumentUnit()]
return retval
@@ -387,7 +404,7 @@ class Effect:
return val / (self.__uuconv[unit] / self.__uuconv[self.getDocumentUnit()])
def addDocumentUnit(self, value):
- ''' Add document unit when no unit is specified in the string '''
+ """Add document unit when no unit is specified in the string """
try:
float(value)
return value + self.getDocumentUnit()
diff --git a/share/extensions/inkwebeffect.py b/share/extensions/inkwebeffect.py
index 994f74dea..4e29892de 100755
--- a/share/extensions/inkwebeffect.py
+++ b/share/extensions/inkwebeffect.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, sys, os, re
diff --git a/share/extensions/interp.py b/share/extensions/interp.py
index 093a98fda..9dbb996e4 100755
--- a/share/extensions/interp.py
+++ b/share/extensions/interp.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, cubicsuperpath, simplestyle, copy, math, bezmisc, simpletransform, pathmodifier
diff --git a/share/extensions/interp_att_g.py b/share/extensions/interp_att_g.py
index 168e7ffb0..2ae46b46d 100755
--- a/share/extensions/interp_att_g.py
+++ b/share/extensions/interp_att_g.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import math
diff --git a/share/extensions/layers2svgfont.py b/share/extensions/layers2svgfont.py
index 379e8e34c..e449ae380 100755
--- a/share/extensions/layers2svgfont.py
+++ b/share/extensions/layers2svgfont.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/layout_nup.py b/share/extensions/layout_nup.py
index 266a3950d..022aa0d3f 100755
--- a/share/extensions/layout_nup.py
+++ b/share/extensions/layout_nup.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
import sys
diff --git a/share/extensions/lindenmayer.py b/share/extensions/lindenmayer.py
index eb0d84328..8e1c4ac22 100755
--- a/share/extensions/lindenmayer.py
+++ b/share/extensions/lindenmayer.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplestyle, pturtle, random
from simpletransform import computePointInNode
diff --git a/share/extensions/lorem_ipsum.py b/share/extensions/lorem_ipsum.py
index 20a2fdd18..efb2361ea 100755
--- a/share/extensions/lorem_ipsum.py
+++ b/share/extensions/lorem_ipsum.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
'''
Example filltext sentences generated over at http://lipsum.com/
diff --git a/share/extensions/markers_strokepaint.py b/share/extensions/markers_strokepaint.py
index d92716939..76284b234 100755
--- a/share/extensions/markers_strokepaint.py
+++ b/share/extensions/markers_strokepaint.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import random
diff --git a/share/extensions/measure.py b/share/extensions/measure.py
index 9fc632c2a..fe981e39e 100755
--- a/share/extensions/measure.py
+++ b/share/extensions/measure.py
@@ -23,7 +23,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
TODO:
* should use the standard attributes for text
diff --git a/share/extensions/merge_styles.py b/share/extensions/merge_styles.py
index f028bf4ce..cdd7b5ed5 100755
--- a/share/extensions/merge_styles.py
+++ b/share/extensions/merge_styles.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Merges styles into class based styles and removes.
diff --git a/share/extensions/motion.py b/share/extensions/motion.py
index 9bf31e008..3af80d5c1 100755
--- a/share/extensions/motion.py
+++ b/share/extensions/motion.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import math, inkex, simplestyle, simplepath, bezmisc
diff --git a/share/extensions/new_glyph_layer.py b/share/extensions/new_glyph_layer.py
index cb7dba854..d6622cc62 100755
--- a/share/extensions/new_glyph_layer.py
+++ b/share/extensions/new_glyph_layer.py
@@ -14,11 +14,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
import sys
+import locale
+
class NewGlyphLayer(inkex.Effect):
def __init__(self):
@@ -27,10 +29,13 @@ class NewGlyphLayer(inkex.Effect):
action="store", type="string",
dest="unicodechars", default='',
help="Unicode chars")
+ self.encoding = sys.stdin.encoding
+ if self.encoding == 'cp0' or self.encoding is None:
+ self.encoding = locale.getpreferredencoding()
def effect(self):
# Get all the options
- unicode_chars = self.options.unicodechars
+ unicode_chars = self.options.unicodechars.decode(self.encoding)
#TODO: remove duplicate chars
@@ -40,7 +45,7 @@ class NewGlyphLayer(inkex.Effect):
for char in unicode_chars:
# Create a new layer.
layer = inkex.etree.SubElement(svg, 'g')
- layer.set(inkex.addNS('label', 'inkscape'), 'GlyphLayer-'+char)
+ layer.set(inkex.addNS('label', 'inkscape'), u'GlyphLayer-'+char)
layer.set(inkex.addNS('groupmode', 'inkscape'), 'layer')
layer.set('style', 'display:none') #initially not visible
diff --git a/share/extensions/next_glyph_layer.py b/share/extensions/next_glyph_layer.py
index f8a43aff5..5f152c71e 100755
--- a/share/extensions/next_glyph_layer.py
+++ b/share/extensions/next_glyph_layer.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/param_curves.py b/share/extensions/param_curves.py
index d8f880d0c..e38d5208a 100755
--- a/share/extensions/param_curves.py
+++ b/share/extensions/param_curves.py
@@ -18,7 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Changes:
* This program is derived by Michel Chatelain from funcplot.py. His changes are in the Public Domain.
diff --git a/share/extensions/pathalongpath.py b/share/extensions/pathalongpath.py
index 234430acd..93bb99d6b 100755
--- a/share/extensions/pathalongpath.py
+++ b/share/extensions/pathalongpath.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
barraud@math.univ-lille1.fr
Quick description:
diff --git a/share/extensions/pathmodifier.py b/share/extensions/pathmodifier.py
index ff2bbfb3a..d80b6eeae 100755
--- a/share/extensions/pathmodifier.py
+++ b/share/extensions/pathmodifier.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
barraud@math.univ-lille1.fr
This code defines a basic class (PathModifier) of effects whose purpose is
diff --git a/share/extensions/pathscatter.py b/share/extensions/pathscatter.py
index 5c2857979..92af6ad76 100755
--- a/share/extensions/pathscatter.py
+++ b/share/extensions/pathscatter.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
barraud@math.univ-lille1.fr
Quick description:
diff --git a/share/extensions/perfectboundcover.py b/share/extensions/perfectboundcover.py
index 9f81dbb36..e69bcf4c2 100755
--- a/share/extensions/perfectboundcover.py
+++ b/share/extensions/perfectboundcover.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import sys, inkex
diff --git a/share/extensions/perspective.py b/share/extensions/perspective.py
index a6ee5810b..febe34a22 100755
--- a/share/extensions/perspective.py
+++ b/share/extensions/perspective.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Perspective approach & math by Dmitry Platonov, shadowjack@mail.ru, 2006
"""
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py
index 7e34f2953..60858cc6c 100755
--- a/share/extensions/plotter.py
+++ b/share/extensions/plotter.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
diff --git a/share/extensions/polyhedron_3d.py b/share/extensions/polyhedron_3d.py
index 8e4a8e8e6..7ce8b1c6d 100755
--- a/share/extensions/polyhedron_3d.py
+++ b/share/extensions/polyhedron_3d.py
@@ -46,7 +46,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import sys
diff --git a/share/extensions/previous_glyph_layer.py b/share/extensions/previous_glyph_layer.py
index 801570d65..5e9de1fb8 100755
--- a/share/extensions/previous_glyph_layer.py
+++ b/share/extensions/previous_glyph_layer.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/print_win32_vector.py b/share/extensions/print_win32_vector.py
index 37c2021ac..bf8e89845 100755
--- a/share/extensions/print_win32_vector.py
+++ b/share/extensions/print_win32_vector.py
@@ -25,7 +25,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
from ctypes import *
diff --git a/share/extensions/printing_marks.py b/share/extensions/printing_marks.py
index 0306048d6..6c718da01 100755
--- a/share/extensions/printing_marks.py
+++ b/share/extensions/printing_marks.py
@@ -21,7 +21,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
from subprocess import Popen, PIPE, STDOUT
diff --git a/share/extensions/pturtle.py b/share/extensions/pturtle.py
index b2740a4bc..a4925bf4c 100755
--- a/share/extensions/pturtle.py
+++ b/share/extensions/pturtle.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import math
class pTurtle:
diff --git a/share/extensions/radiusrand.py b/share/extensions/radiusrand.py
index e272a50c4..e4585ccd4 100755
--- a/share/extensions/radiusrand.py
+++ b/share/extensions/radiusrand.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import random, math, inkex, cubicsuperpath
diff --git a/share/extensions/render_alphabetsoup.py b/share/extensions/render_alphabetsoup.py
index a2cbcb978..06c82cb2d 100755
--- a/share/extensions/render_alphabetsoup.py
+++ b/share/extensions/render_alphabetsoup.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import copy
diff --git a/share/extensions/render_barcode.py b/share/extensions/render_barcode.py
index 4f1464a92..381f3fc76 100755
--- a/share/extensions/render_barcode.py
+++ b/share/extensions/render_barcode.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
Inkscape's general barcode extension. Run from within inkscape or use the
diff --git a/share/extensions/render_barcode_datamatrix.py b/share/extensions/render_barcode_datamatrix.py
index 72ffddbe6..82c827bb8 100755
--- a/share/extensions/render_barcode_datamatrix.py
+++ b/share/extensions/render_barcode_datamatrix.py
@@ -43,7 +43,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
######VERSION HISTORY#####
Ver. Date Notes
diff --git a/share/extensions/render_gear_rack.py b/share/extensions/render_gear_rack.py
index 63433aadb..95076ba64 100755
--- a/share/extensions/render_gear_rack.py
+++ b/share/extensions/render_gear_rack.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/render_gears.py b/share/extensions/render_gears.py
index 2584117f2..fbec5d052 100755
--- a/share/extensions/render_gears.py
+++ b/share/extensions/render_gears.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/rtree.py b/share/extensions/rtree.py
index c0dc1cca6..b336c4e3a 100755
--- a/share/extensions/rtree.py
+++ b/share/extensions/rtree.py
@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplestyle, pturtle, random
from simpletransform import computePointInNode
diff --git a/share/extensions/rubberstretch.py b/share/extensions/rubberstretch.py
index 95d1cffb5..2e6b85ad5 100755
--- a/share/extensions/rubberstretch.py
+++ b/share/extensions/rubberstretch.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
barraud@math.univ-lille1.fr
'''
diff --git a/share/extensions/setup_typography_canvas.py b/share/extensions/setup_typography_canvas.py
index a1000f2d1..209c9757f 100755
--- a/share/extensions/setup_typography_canvas.py
+++ b/share/extensions/setup_typography_canvas.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/simplepath.py b/share/extensions/simplepath.py
index 514dd4666..5d99e46e7 100644
--- a/share/extensions/simplepath.py
+++ b/share/extensions/simplepath.py
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
import re, math
diff --git a/share/extensions/simplestyle.py b/share/extensions/simplestyle.py
index ca33e68a4..32328a40d 100644
--- a/share/extensions/simplestyle.py
+++ b/share/extensions/simplestyle.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
svgcolors={
diff --git a/share/extensions/simpletransform.py b/share/extensions/simpletransform.py
index 8b6f46935..f6f68d2be 100644
--- a/share/extensions/simpletransform.py
+++ b/share/extensions/simpletransform.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
barraud@math.univ-lille1.fr
This code defines several functions to make handling of transform
diff --git a/share/extensions/spirograph.py b/share/extensions/spirograph.py
index e702344a5..02cb02bcd 100755
--- a/share/extensions/spirograph.py
+++ b/share/extensions/spirograph.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex, simplestyle, math
from simpletransform import computePointInNode
diff --git a/share/extensions/split.py b/share/extensions/split.py
index 18d4327fe..4e83b3d33 100755
--- a/share/extensions/split.py
+++ b/share/extensions/split.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/straightseg.py b/share/extensions/straightseg.py
index f18658012..9222ed5b5 100755
--- a/share/extensions/straightseg.py
+++ b/share/extensions/straightseg.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import math, inkex, simplepath, sys
diff --git a/share/extensions/summersnight.py b/share/extensions/summersnight.py
index fbf88fe92..7af4bb571 100755
--- a/share/extensions/summersnight.py
+++ b/share/extensions/summersnight.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
# standard library
diff --git a/share/extensions/svg_and_media_zip_output.py b/share/extensions/svg_and_media_zip_output.py
index 20a5dac18..c5963b721 100755
--- a/share/extensions/svg_and_media_zip_output.py
+++ b/share/extensions/svg_and_media_zip_output.py
@@ -26,7 +26,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
TODOs
- fix bug: not saving existing .zip after a Collect for Output is run
diff --git a/share/extensions/svgcalendar.py b/share/extensions/svgcalendar.py
index a4269f5d7..9f221a807 100755
--- a/share/extensions/svgcalendar.py
+++ b/share/extensions/svgcalendar.py
@@ -25,7 +25,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
__version__ = "0.3"
diff --git a/share/extensions/svgfont2layers.py b/share/extensions/svgfont2layers.py
index 48100e3f5..1a392c72c 100755
--- a/share/extensions/svgfont2layers.py
+++ b/share/extensions/svgfont2layers.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/tar_layers.py b/share/extensions/tar_layers.py
index 3707af1f8..3ba5aa55e 100755
--- a/share/extensions/tar_layers.py
+++ b/share/extensions/tar_layers.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
An extension to export multiple svg files from a single svg file containing layers.
diff --git a/share/extensions/triangle.py b/share/extensions/triangle.py
index ecd977d40..32bd2a1db 100755
--- a/share/extensions/triangle.py
+++ b/share/extensions/triangle.py
@@ -29,7 +29,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/voronoi.py b/share/extensions/voronoi.py
index 8661bc9bf..ac2c13f8f 100755..100644
--- a/share/extensions/voronoi.py
+++ b/share/extensions/voronoi.py
@@ -395,6 +395,8 @@ class Edge(object):
else:
# set formula of line, with y fixed to 1
newedge.b = 1.0
+ if dy <= 0:
+ dy = 0.01
newedge.a = dx/dy
newedge.c /= dy
diff --git a/share/extensions/voronoi2svg.inx b/share/extensions/voronoi2svg.inx
index d86ebd819..c07dbb8e5 100644
--- a/share/extensions/voronoi2svg.inx
+++ b/share/extensions/voronoi2svg.inx
@@ -18,6 +18,12 @@
<_item value="Automatic from seeds">Automatic from selected objects</_item>
</param>
<param name="show-clip-box" type="boolean" _gui-text="Show the bounding box"></param>
+ <_param name="Delaunay Options" type="description" appearance="header">Options for Delaunay Triangulation</_param>
+ <param name="delaunay-fill-options" _gui-text="Triangles color" type="optiongroup">
+ <_option value="delaunay-no-fill">Default (Stroke black and no fill)</_option>
+ <_option value="delaunay-fill">Triangles with item color</_option>
+ <_option value="delaunay-fill-random">Triangles with item color (random on apply)</_option>
+ </param>
</page>
<page name="help" _gui-text="Help">
<_param name="help_text" type="description">Select a set of objects. Their centroids will be used as the sites of the Voronoi diagram. Text objects are not handled.</_param>
diff --git a/share/extensions/voronoi2svg.py b/share/extensions/voronoi2svg.py
index 26a89393c..d4740b7f5 100755..100644
--- a/share/extensions/voronoi2svg.py
+++ b/share/extensions/voronoi2svg.py
@@ -36,6 +36,7 @@ import simplestyle
import simplepath
import simpletransform
import voronoi
+import random
inkex.localize()
@@ -76,7 +77,13 @@ class Voronoi2svg(inkex.Effect):
default = False,
dest='showClipBox',
help = 'Set this to true to write the bounding box')
-
+ self.OptionParser.add_option(
+ '--delaunay-fill-options',
+ action = 'store',
+ type = 'string',
+ default = "delaunay-no-fill",
+ dest='delaunayFillOptions',
+ help = 'Set the Delaunay triangles color options')
#}}}
#{{{ Clipping a line by a bounding box
@@ -191,7 +198,8 @@ class Voronoi2svg(inkex.Effect):
#}}}
def effect(self):
-
+ #saveout = sys.stdout
+ #sys.stdout = sys.stderr
#{{{ Check that elements have been selected
if len(self.options.ids) == 0:
@@ -203,15 +211,19 @@ class Voronoi2svg(inkex.Effect):
#{{{ Drawing styles
linestyle = {
- 'stroke' : '#000000',
- 'stroke-width' : str(self.unittouu('1px')),
- 'fill' : 'none'
+ 'stroke' : '#000000',
+ 'stroke-width' : str(self.unittouu('1px')),
+ 'fill' : 'none',
+ 'stroke-linecap' : 'round',
+ 'stroke-linejoin' : 'round'
}
-
+
facestyle = {
- 'stroke' : '#ff0000',
- 'stroke-width' : str(self.unittouu('1px')),
- 'fill' : 'none'
+ 'stroke' : '#000000',
+ 'stroke-width' : str(self.unittouu('1px')),
+ 'fill' : 'none',
+ 'stroke-linecap' : 'round',
+ 'stroke-linejoin' : 'round'
}
#}}}
@@ -231,6 +243,7 @@ class Voronoi2svg(inkex.Effect):
pts = []
nodes = []
seeds = []
+ fills = []
for id in self.options.ids:
@@ -244,6 +257,20 @@ class Voronoi2svg(inkex.Effect):
if trans:
simpletransform.applyTransformToPoint(trans,pt)
pts.append(Point(pt[0],pt[1]))
+ fill = 'none'
+ if self.options.delaunayFillOptions != "delaunay-no-fill":
+ if node.attrib.has_key('style'):
+ style = node.get('style') # fixme: this will break for presentation attributes!
+ if style:
+ declarations = style.split(';')
+ for i,decl in enumerate(declarations):
+ parts = decl.split(':', 2)
+ if len(parts) == 2:
+ (prop, val) = parts
+ prop = prop.strip().lower()
+ if prop == 'fill':
+ fill = val.strip()
+ fills.append(fill)
seeds.append(Point(cx,cy))
#}}}
@@ -327,6 +354,9 @@ class Voronoi2svg(inkex.Effect):
if self.options.diagramType != 'Voronoi':
triangles = voronoi.computeDelaunayTriangulation(seeds)
+ i = 0;
+ if self.options.delaunayFillOptions == "delaunay-fill":
+ random.seed("inkscape")
for triangle in triangles:
p1 = seeds[triangle[0]]
p2 = seeds[triangle[1]]
@@ -335,11 +365,20 @@ class Voronoi2svg(inkex.Effect):
['L',[p2.x,p2.y]],
['L',[p3.x,p3.y]],
['Z',[]]]
+ if self.options.delaunayFillOptions == "delaunay-fill" or self.options.delaunayFillOptions == "delaunay-fill-random":
+ facestyle = {
+ 'stroke' : fills[triangle[random.randrange(0, 2)]],
+ 'stroke-width' : str(self.unittouu('0.005px')),
+ 'fill' : fills[triangle[random.randrange(0, 2)]],
+ 'stroke-linecap' : 'round',
+ 'stroke-linejoin' : 'round'
+ }
path = inkex.etree.Element(inkex.addNS('path','svg'))
path.set('d',simplepath.formatPath(cmds))
path.set('style',simplestyle.formatStyle(facestyle))
groupDelaunay.append(path)
-
+ i += 1;
+ #sys.stdout = saveout
#}}}
diff --git a/share/extensions/web-set-att.py b/share/extensions/web-set-att.py
index b224ed9aa..0dafcb974 100755
--- a/share/extensions/web-set-att.py
+++ b/share/extensions/web-set-att.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
import inkwebeffect
diff --git a/share/extensions/web-transmit-att.py b/share/extensions/web-transmit-att.py
index 414eb12ea..bae6956b2 100755
--- a/share/extensions/web-transmit-att.py
+++ b/share/extensions/web-transmit-att.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
import inkwebeffect
diff --git a/share/extensions/webslicer_create_group.py b/share/extensions/webslicer_create_group.py
index dd48c3e96..47e5f706f 100755
--- a/share/extensions/webslicer_create_group.py
+++ b/share/extensions/webslicer_create_group.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
from webslicer_effect import *
diff --git a/share/extensions/webslicer_create_rect.py b/share/extensions/webslicer_create_rect.py
index b4e6858af..b68cd9ad8 100755
--- a/share/extensions/webslicer_create_rect.py
+++ b/share/extensions/webslicer_create_rect.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# local library
from webslicer_effect import *
diff --git a/share/extensions/webslicer_effect.py b/share/extensions/webslicer_effect.py
index d91d0ce85..acb78fcbd 100755
--- a/share/extensions/webslicer_effect.py
+++ b/share/extensions/webslicer_effect.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import inkex
diff --git a/share/extensions/webslicer_export.py b/share/extensions/webslicer_export.py
index a8a3c67ba..47db5369c 100755
--- a/share/extensions/webslicer_export.py
+++ b/share/extensions/webslicer_export.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
import os
diff --git a/share/extensions/whirl.py b/share/extensions/whirl.py
index 7ee9cc0a2..93e04c60d 100755
--- a/share/extensions/whirl.py
+++ b/share/extensions/whirl.py
@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
import math, inkex, cubicsuperpath
from simpletransform import computePointInNode
diff --git a/share/extensions/wireframe_sphere.py b/share/extensions/wireframe_sphere.py
index bda06af21..64a1266b6 100755
--- a/share/extensions/wireframe_sphere.py
+++ b/share/extensions/wireframe_sphere.py
@@ -45,7 +45,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
######VERSION HISTORY#####
Ver. Date Notes