This extends the existing XML-based template generator to allow an
additional kind of Python-based input.
The Python code is read as source code to an AST to a typed model
equivalent to the existing XML model, and processed by the existing
code templates into compatible code.
This provides a few benefits, namely readability is much increased,
but more importantly, it allows associating the APIs with Python's new
typing information, which will allow to provide accurate type hinting
without additional downstream processing in the future.
Right now this is just a proof-of-concept but if the approach is
well received, then a more complete implementation can be done with
further conversion of existing binding files.
Here is an example of how it looks, though I still think the metadata
is too verbose and can be made to look nicer with some further work.
```python
from ..Base.Metadata import metadata
from ..Base.Persistence import PersistencePy
from typing import Any, Optional, List
@metadata(
Father="PersistencePy",
Name="DocumentPy",
Twin="Document",
TwinPointer="Document",
Include="Gui/Document.h",
Namespace="Gui",
FatherInclude="Base/PersistencePy.h",
FatherNamespace="Base"
)
class DocumentPy(PersistencePy):
"""
This is a Document class.
Author: Werner Mayer (wmayer@users.sourceforge.net)
Licence: LGPL
"""
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""
Constructor for DocumentPy.
"""
super(DocumentPy, self).__init__(*args, **kwargs)
pass
def show(self, objName: str) -> None:
"""
show(objName) -> None
Show an object.
Parameters:
objName (str): Name of the `Gui.ViewProvider` to show.
"""
pass
```
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
Fixes#16333.
Follow-up of #19487.
* The functions have been made nesting-aware. New objects are put in the same container (Group, Part) as the original objects. As a consequence for some operations the original objects must be in the same container as well.
* New objects receive the visual properties of the original objects. This is not always perfect. For example when upgrading to multiple wires there is currently no check to see which edge came from which orginal object. The fact that the `format_object` function is called from the Draft `make*` functions is problematic here. If construction mode is active `make_wire` puts new objects in the construction group and we don't always want that. This has been solved with a workaround (see 'cludge' in the code).
* The 'de-parametrize' downgrade option has also been enabled for features of PartDesign Bodies that have the `Profile` property.
* Before deleting objects there is a check to see if they are in use elsewhere (`InList` check). Base objects of arrays are not deleted if they are visible. If a PartDesign Body, or an object inside a Body is selected, the whole Body is deleted.
* The force options did not work for functions that take a single object.
* The `getShapeFromMesh` function in ArchCommands.py could return a solid that was not closed. A check for that has been added.
Its pretty helpful when developing to have multiple build directories
for different branches.
This adds such pattern to .gitignore to be able to have a sane Git
experience.
* Fix duplicated groups
* Fixed windows spaning several floors
* Fixing doorOrWindow positioning. Allowing to DEBUG_GEOMETRY
* Fixed default color for floor and ground
* Fixed some windows positioning issue
* Fixed invalid modification of wall array. Changed default window type to allow opening
* fixed some import failures. Added some new windows
* Fixed some more edge cases
* Use doc transaction. Fixed import of room based on self-intersecting polygon.
* Added default furniture color. Fixed wall reference face to fix slab creation
* Replace Debug setting by DebugGeometry
* Fixed corner cases when importing Door & Furniitures
* Fix emissive color and shininess
* Remove external package dependency
* Fixed furniture placement and transformation
* Make sure lights are properly imported
* Fixed duplicated camera and ground when merging
- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
* Start: add optional additional folder view
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added logic to migrate ShowCustomFolder parameter
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Rename Additional to Custom folder
* Change Start page text to sentence case for consistency
* Fix breakage created by pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Rearrange migration logic to make it more explicit
* Revert "Change Start page text to sentence case for consistency"
This reverts commit 8a31a1238c0380ddbe13e6e5838a3be6b13400a5.
* Make parameterGroup local
* Apply suggestions and linter improvements
* Adapted suggestion to simplify migration logic
* Start: Warning -> Message for rename of ShowCustomFolder
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>