Avoid `Draft.py` in the `make_ortho_array` function because
it creates a circular dependency.
Use internal functions to abstract the orthogonal arrays.
The `_make_ortho_array` is a simple wrapper over the general
`make_array` function.
The result is four variants:
- `make_ortho_array`
- `make_ortho_array2d`, without the Z component
- `make_rect_array`, strictly rectangular components
- `make_rect_array2d`, strictly rectangular without the Z component
Also use functions to perform checking of the inputs,
whether these are vectors, numbers (integer and floats)
or integers.
Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays quickly from the Python console.
Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
In Python 3 `super()` can be used without an argument
in order to get the parent class, `super()`.
In Python 2 the present class must be used as an argument,
`super(ThisClass, self)`.
This commit is done to support Python 2,
as without it all Gui Command tools will be broken
and will fail to launch, even if the unit tests pass.
Also, set the `__metaclass__` variable to `type`.
This is done to turn all classes into "new style" classes
in Python 2. This is required so `super()` works correctly
in this version of Pyton.
This commit can be reverted once Python 2 support
is completely dropped, and only Python 3 compatible code
is used.
The internal GuiCommand classes are renamed to `CircularArray`,
`OrthoArray`, and `PolarArray`. This is a shorter name than the
previous `GuiCommandCircularArray`, `GuiCommandOrthoArray`,
and `GuiCommandPolarArray`.
These classes are not part of the scripting interface of Draft
so we don't risk breaking previous files.
Small spacing fixes like imports in separate lines
for more clarity, the module docstring,
and the position of the license.
Remove unnecessary check for the graphical interface
as this command should be imported when the interface
is already up and running.
Use proper `ToDo` class instead of importing `DraftGui`.
It replaces the older `Draft_Array` command, and provides
a task panel to select the properties, similar to the
`Draft_PolarArray` and `Draft_CircularArray` commands.
It can also create `App::Links` directly from this task
panel, so it also replaces the `Draft_LinkArray`
introduced by the LinkMerge.