Commit cc7c37b1 authored by Martin Owens's avatar Martin Owens 🤖

Allow ignored methods that do nothing and fix #232 measure inx

parent 7c1b5328
Pipeline #149452480 failed with stages
in 4 minutes and 6 seconds
......@@ -27,10 +27,9 @@ import copy
import shutil
from argparse import ArgumentParser, Namespace
from io import IOBase
from lxml import etree
from .utils import PY3, filename_arg, AbortExtension, ABORT_STATUS, errormsg
from .utils import PY3, filename_arg, AbortExtension, ABORT_STATUS, errormsg, do_nothing
from .elements import load_svg
from .localization import localize
......@@ -106,6 +105,8 @@ class InkscapeExtension(object):
try:
return getattr(self, name)
except AttributeError:
if name.startswith('_'):
return do_nothing
raise AbortExtension("Can not find method {}".format(name))
return _inner
......
......@@ -96,6 +96,9 @@ def debug(what):
errormsg(what)
return what
def do_nothing(*args, **kwargs): # pylint: disable=unused-argument
"""A blank function to do nothing"""
pass
def errormsg(msg):
"""Intended for end-user-visible error messages.
......
......@@ -36,15 +36,15 @@
</param>
<param name="angle" type="float" min="-360" max="360" gui-text="Angle (°):">0</param>
</page>
<page name="desc" gui-text="Help">
<label xml:space="preserve">This effect measures the length, area, or center-of-mass of the selected paths. Length and area are added as a text object with the selected units. Center-of-mass is shown as a cross symbol.
<page name="_help" gui-text="Help">
<label xml:space="preserve">This effect measures the length, area, or center-of-mass of the selected paths. Length and area are added as a text object with the selected units. Center-of-mass is shown as a cross symbol.
* Text display format can be either Text-On-Path, or stand-alone text at a specified angle.
* The number of significant digits can be controlled by the Precision field.
* The Offset field controls the distance from the text to the path.
* The Scale factor can be used to make measurements in scaled drawings. For example, if 1 cm in the drawing equals 2.5 m in the real world, Scale must be set to 250.
* When calculating area, the result should be precise for polygons and Bezier curves. If a circle is used, the area may be too high by as much as 0.03%.</label>
</page>
</page>
</param>
<param name="fontsize" type="int" min="1" max="1000" gui-text="Font size (px):">12</param>
<param name="offset" type="float" min="-10000" max="10000" gui-text="Offset (px):">-6</param>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment