fman icon indicating copy to clipboard operation
fman copied to clipboard

Python console inside fman that shows plugin errors

Open mherrmann opened this issue 8 years ago • 10 comments

mherrmann avatar Mar 21 '17 13:03 mherrmann

Is this a feature request to make a sublime like console in fman so that plugin developpers can debug their application? image I was just about to open a feature request for it :)

kszcode avatar May 30 '17 17:05 kszcode

Hey Kuki, yes that's it :)

mherrmann avatar May 31 '17 07:05 mherrmann

There should also be a command like console.log in web development that allows you to debug plugins.

mherrmann avatar Aug 23 '17 06:08 mherrmann

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.

mherrmann avatar Aug 23 '17 06:08 mherrmann

That's awesome, would it be possible to achieve that in Windows as well, Michael?

kek91 avatar Aug 23 '17 07:08 kek91

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.

mherrmann avatar Aug 23 '17 10:08 mherrmann

I see, thanks for the explanation and I agree with that decision

kek91 avatar Aug 23 '17 11:08 kek91

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

oskretc avatar Apr 11 '18 11:04 oskretc

Interesting suggestion @oskretc. Do you have a particular script in mind?

mherrmann avatar Apr 11 '18 12:04 mherrmann

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.

oskretc avatar Apr 11 '18 12:04 oskretc