* Fix syntax warnings about invalid escape sequences
Backspaces in regular expressions were not escaped properly leading to warnings on every invocation of the program.
* Improve formatting of fcinfo output
* Printing of part BREP file properties (hash and size) has been made optional since these values often change without explicit user action making git diffs almost unreadable by hiding actual changes behind a flood of changed hashes because a base feature further up the history was changed. There is a new option (-p) to re-enable the printing of these file properties.
* Unformatted float outputs have been replaced with proper formatting using f-strings which round the values to a sensible number of places.
* Colors are printed in their native 0-255 range. Printing them as float brings no benefit here.
* Most string concatenation for output has been replaced with f-strings
* Fix printing of color properties
The old CAD model created by the development version of FreeCAD
(in which the Assembly workbench was used) contained joints that,
for some reason, had an empty Joint Connector 1 reference (Reference1).
This was causing an exception and a crash of the Python function
called migrationScript4. The FreeCAD Report view contained:
23:28:29 pyException: Traceback (most recent call last):
File "/FreeCAD/Mod/Assembly/JointObject.py", line 175, in onDocumentRestored
self.createProperties(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 181, in createProperties
self.migrationScript4(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 514, in migrationScript4
if hasattr(joint, "Reference1") and joint.Reference1[0] is not None:
~~~~~~~~~~~~~~~~^^^
<class 'TypeError'>: 'NoneType' object is not subscriptable
This patch attempts to avoid such exceptions by validating the type of
the property variable before accessing it.
Qt handles resize to content on double clicking the separator in the header, by default.
However this does not work in FreeCAD.
There are no comments on why this was done and is therefore treated as bug instead of feature.
Manual testing has been performed after the change and:
* Scaling by double clicking separator in header works
* Sizes are correctly stored in sheet when resizing to content
Remove implementation details of the Document class from the XMLReader class.
Instead keep an array of failed files and check them in the calling instance.
* BIM: Optimized leader UI - fixes#17284
* Correct task panel icon for BIM Leader.
* Make BIM Leader task panel title translatable.
* Use a single mode parameter for the Line class.
---------
Co-authored-by: Roy-043 <info@b-k-g.nl>
FreeCAD doesn't have a shortcut for Preferences.
As far as I know there is no established standard for Preferences. I
chose Ctrl+, as that is used by a number of applications, like VS Code,
nautilus and gedit.
* Draft: Fix AnnotationStyleEditor delete last style error
Fixes#17716.
* Fix rename problem as well
The on_rename function should update self.current_style as well. To avoid this scenario:
1. Create style A.
2. Create style B.
3. Rename style B to C.
4. Switch to style A.
5. Press OK.
6. Start the tool again.
7. Result: there are 3 styles A, B and C.