* 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
This prevents the following error when using fcinfo as diff driver for WebTools Git:
(...)
File "/usr/local/bin/fcinfo", line 89, in startElement
print (" " + key + " : " + val)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 17: ordinal not in range(128)
fatal: unable to read files to diff
This utility prints information about a given FreeCAD file (*.FCStd)
on screen, including document properties, number of included objects
and object sizes.
It can be used as a textconv tool for git diff by adding this utility to
your exec path andadding this entry to .gitattributes: *.fcstd diff=fcinfo
Usage: fcinfo myfile.FCStd