Skip to content

Conversation

@DaniloMitrovic
Copy link

@DaniloMitrovic DaniloMitrovic commented Apr 16, 2025

Made base Exceptions and Messaging objects that works in Console and FreeCAD in fc_exceptions.py
Added them to init.py
Made main.py for testing purposes.
Usable with -O and -OO python flags.

(some bug: Notices (FreeCAD.Console.printNotificiation - doesn't trigger gui but prints, but that works as well).

Made base Exceptions and Messaging system that works in Console and FreeCAD so any new stuff doesn't have to be tested in FreeCAD (unless dependent on ). 

Wrote some docs that would work with python keyword help(whatever).
@FlachyJoe
Copy link
Owner

Interesting but I'm not sure this labyrinthine system − "usine à gaz" in French − adds much to the current operation of the FreeCAD console.
And IMHO a workbench is, by definition, not intended to operate independently so the stdout usage is not required.

I've added the Notification level to the update I'm pushing in dev branch: 8357d5c.

@DaniloMitrovic
Copy link
Author

DaniloMitrovic commented Apr 16, 2025

Well its fair that it doesn't add much to the current operator to FCPD, I agree. However whole Workbench system isn't fully implemented to fully support python, since its primitives are partially locked (some are some aren't).

Id agree that workbench is, by definition, not intended to operate independently of FreeCAD but no one is stopping anyone to implement outside python systems that are (such as Pd). So when developing elements that are already given ax example in WorkBench tutorial stuff like Import/Export creators and custom functionality require 3 sides:

FreeCAD independant side : which works with FreeCAD.
Python independant side: which works with python (sys, os, ...)
Workbench independant side: which works with (partially) exposed FreeCAD functionality.

And it stands to reason that issues in python (such as unescaped double quotations, type or import issues and so on) will avalanche into Workbench and into FreeCAD. To me, it stands to reason that if it works in python, same python code will work with FreeCAD by simply checking globals (dictionary) locals (dictionary) and etc since python ins't strongly typed strict. Why wouldn't someone want to unittest python side before going into workbench (and extension) FreeCAD?

That being said, you are in no obligation to merge. I just quickly did that so that its possible to separate informing the developer and informing user. This way, one who coded it allways knows whats up, and user ins't to distracted by pythons traceback which (lets be honest) most can't read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants