Draft: move make_label function to its own module
Also perform several improvements such as PEP8 cleanup, writing complete docstrings, type checking the input arguments, and deprecating the older call. Update `Draft.py`, the Gui Command, the unit test, and test script as well.
This commit is contained in:
@@ -354,9 +354,10 @@ def _create_objects(doc=None,
|
||||
_msg(16 * "-")
|
||||
_msg("Label")
|
||||
place = App.Placement(Vector(18500, 500, 0), App.Rotation())
|
||||
label = Draft.make_label(targetpoint=Vector(18000, 0, 0),
|
||||
distance=-250,
|
||||
placement=place)
|
||||
label = Draft.make_label(target_point=Vector(18000, 0, 0),
|
||||
placement=place,
|
||||
custom_text="Example label",
|
||||
distance=-250)
|
||||
label.Text = "Testing"
|
||||
if App.GuiUp:
|
||||
label.ViewObject.ArrowSize = 15
|
||||
|
||||
@@ -321,7 +321,7 @@ class DraftCreation(unittest.TestCase):
|
||||
_msg(" target_point={0}, "
|
||||
"distance={1}".format(target_point, distance))
|
||||
_msg(" placement={}".format(placement))
|
||||
obj = Draft.make_label(targetpoint=target_point,
|
||||
obj = Draft.make_label(target_point=target_point,
|
||||
distance=distance,
|
||||
placement=placement)
|
||||
self.doc.recompute()
|
||||
|
||||
Reference in New Issue
Block a user