Eliminate many "doing what you told me to" messages
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
This commit is contained in:
@@ -38,7 +38,7 @@ import FreeCAD as App
|
||||
import draftutils.utils as utils
|
||||
import draftutils.gui_utils as gui_utils
|
||||
|
||||
from draftutils.messages import _msg, _err
|
||||
from draftutils.messages import _err
|
||||
from draftutils.translate import translate
|
||||
from draftobjects.pointarray import PointArray
|
||||
|
||||
@@ -84,7 +84,6 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
|
||||
If there is a problem it will return `None`.
|
||||
"""
|
||||
_name = "make_point_array"
|
||||
utils.print_header(_name, "Point array")
|
||||
|
||||
found, doc = utils.find_doc(App.activeDocument())
|
||||
if not found:
|
||||
@@ -96,31 +95,26 @@ def make_point_array(base_object, point_object, extra=None, use_link=True):
|
||||
|
||||
found, base_object = utils.find_object(base_object, doc)
|
||||
if not found:
|
||||
_msg("base_object: {}".format(base_object_str))
|
||||
_err(translate("draft", "Wrong input: object not in document."))
|
||||
_err(translate("draft", "Wrong input: base_object {} not in document.").format(base_object_str))
|
||||
return None
|
||||
|
||||
_msg("base_object: {}".format(base_object.Label))
|
||||
|
||||
if isinstance(point_object, str):
|
||||
point_object_str = point_object
|
||||
|
||||
found, point_object = utils.find_object(point_object, doc)
|
||||
if not found:
|
||||
_msg("point_object: {}".format(point_object_str))
|
||||
_err(translate("draft", "Wrong input: object not in document."))
|
||||
_err(translate("draft", "Wrong input: point_object {} not in document.").format(point_object_str))
|
||||
return None
|
||||
|
||||
_msg("point_object: {}".format(point_object.Label))
|
||||
if not ((hasattr(point_object, "Shape") and hasattr(point_object.Shape, "Vertexes"))
|
||||
or hasattr(point_object, "Mesh")
|
||||
or hasattr(point_object, "Points")):
|
||||
_err(translate("draft", "Wrong input: object has the wrong type."))
|
||||
return None
|
||||
|
||||
_msg("extra: {}".format(extra))
|
||||
if not extra:
|
||||
extra = App.Placement()
|
||||
|
||||
try:
|
||||
utils.type_check([(extra, (App.Placement,
|
||||
App.Vector,
|
||||
|
||||
Reference in New Issue
Block a user