I think you should remove the comment lines and blocks that separate the functions, they are annoying and not needed. Whitespace is what will visually tell you when a block of code starts or ends.
I find strange your convention of variables in browser.py. Variables that start with an underscore are meant to be hidden, private to a single function or module. But in your case, you use them as global variables. And I don't get why you need them to be global. You should try to pass variables more, instead of having them global all over the place.
Code: Select all
_browser_instance = None
_browser_session = {}
Also, in general, using eval is bad. I would try to avoid it.
I strongly advice you to use Python's snake_case functions. It seems you used camelCase in many cases, but that is not Pythonic. Check PEP8. Use an editor like Spyder, which will immediately check your style while you type.
Also, don't import modules inside functions. Place the imports at the top of the document where it is easily recognizable what is imported. The first time a module is imported, it is added to the Python cache, so it won't be imported twice. Placing an import like FreeCADGui inside a function in controller.py doesn't make much sense because your tool is graphical, so it will be imported anyway. It should be at the top, where people can clearly see what is being called from elsewhere.