fman
fman copied to clipboard
Python console inside fman that shows plugin errors
Is this a feature request to make a sublime like console in fman so that plugin developpers can debug their application?
I was just about to open a feature request for it :)
Hey Kuki, yes that's it :)
There should also be a command like console.log in web development that allows you to debug plugins.
Until console.log is implemented, there is a workaround for Linux and Mac: Start fman from the command line via
- Linux:
/opt/fman/fman - Mac:
/Applications/fman.app/Contents/MacOS/fman
Then you can use print(...) in your plugin and see the output in your Terminal window.
That's awesome, would it be possible to achieve that in Windows as well, Michael?
I'm afraid on Windows it won't be easy. The reason is that on Windows, each .exe is either a GUI app or a console app. It's not normally possible (except with some trickery) for a GUI app to be attached to a console. I don't think it makes sense to implement this now. I'd rather do the proper console.log implementation so the workaround isn't even required.
I see, thanks for the explanation and I agree with that decision
Maybe a different topic but a bit related
Is it possible to interact with some of the API modules directly from a python script?. This way you could debug some parts of your code as standalone scripts and the later integrate them as plugins
Interesting suggestion @oskretc. Do you have a particular script in mind?
Something very basic, but it took me quite a while to figure it out
from fman.url import as_human_readable, as_url
print as_human_readable('file:/c:/tmp')
# This throws an error but it took me some time to figure it out.