Draft: correct description of draftutils package
These utilities are general in the entire workbench, some of them can be used without a GUI, and some of them absolutely require the GUI to function.
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
2020 February
|
||||
2020 May
|
||||
|
||||
These files provide auxiliary functions used by the Draft workbench.
|
||||
Previously most of these were in `Draft.py`, `DraftTools.py`
|
||||
and `DraftGui.py`.
|
||||
|
||||
Previously most of these functions were defined in `Draft.py`,
|
||||
`DraftTools.py`, and `DraftGui.py`. However, due to being defined in these
|
||||
big modules, it was impossible to use them individually without importing
|
||||
the entire modules. So a decision was made to split the functions
|
||||
into smaller modules.
|
||||
|
||||
In here we want modules with generic functions that can be used everywhere
|
||||
in the workbench. We want these tools to depend only on standard modules
|
||||
so that there are no circular dependencies, and so that they can be used
|
||||
by all functions and graphical commands in this workbench
|
||||
and possibly other workbenches.
|
||||
in the workbench. We want these tools to depend only on standard Python
|
||||
modules and basic FreeCAD methods so that there are no circular dependencies,
|
||||
and so that they can be used by all functions and graphical commands
|
||||
in this workbench, and others if possible.
|
||||
- `utils`: basic functions
|
||||
- `messages`: used to print messages
|
||||
- `translate`: used to translate texts
|
||||
@@ -18,6 +22,7 @@ and possibly other workbenches.
|
||||
Some auxiliary functions require that the graphical interface is loaded
|
||||
as they deal with scripted objects' view providers or the 3D view.
|
||||
- `gui_utils`: basic functions dealing with the graphical interface
|
||||
- `init_draft_statusbar`: functions to initialize the status bar
|
||||
|
||||
For more information see the thread:
|
||||
[[Discussion] Splitting Draft tools into their own modules](https://forum.freecadweb.org/viewtopic.php?f=23&t=38593&start=10#p341298)
|
||||
|
||||
@@ -1,6 +1,50 @@
|
||||
"""Utility functions that do not require the graphical user interface.
|
||||
# ***************************************************************************
|
||||
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
|
||||
# * *
|
||||
# * This file is part of the FreeCAD CAx development system. *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with FreeCAD; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""Utility modules that are used throughout the workbench.
|
||||
|
||||
These functions are used throughout the Draft Workbench.
|
||||
They can be called from any module, whether it uses the graphical
|
||||
user interface or not.
|
||||
These modules include functions intended to be quite general,
|
||||
so they should be useful in all other modules in the workbench
|
||||
and even other workbenches.
|
||||
Since they are not meant to be very complex, they shouldn't require
|
||||
a lot of prerequisites, and shouldn't cause problems of circular imports.
|
||||
|
||||
They include modules that don't require the graphical interface (GUI),
|
||||
as well as functions that do require it because they interact
|
||||
with the view providers or with the 3D view.
|
||||
|
||||
Non GUI modules
|
||||
---------------
|
||||
- `utils`, generic functions
|
||||
- `messages`, shorthands to print to the console
|
||||
- `translate`, translate text using QtCore
|
||||
|
||||
GUI modules
|
||||
-----------
|
||||
- `gui_utils`, generic functions that deal with the graphical interface
|
||||
- `todo`, delay execution of Python code through Qt
|
||||
|
||||
Initialization modules for the GUI
|
||||
----------------------------------
|
||||
- `init_tools`, initialize toolbars and menus of the workbench
|
||||
- `init_draft_statusbar`, initialize the status bar of the workbench
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user