Python debugger, python editor

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mumme
Posts: 35
Joined: Sun Jun 21, 2015 4:52 pm

Python debugger, python editor

Post by mumme »

Edit: this project has now been forked by @ferranpujolcamins, see this post for more details

Hi!

Just to let you know...

I have started to make the builtin python debugger workable, and did some fixes to the editor to make it more user friendly.
The codebase already had some functionality for a python debugger, so I mostly got that thing to work and added a stacktrace viewer and a variable explorer.

The end goal is of course to have this patch merged, although it certainly isn't there yet.

I managed to make the debugger work on my Linux machine (with some bugs of course).
It currently only works with one file and cant trap events.
I'm not sure really why events doesn't gets routed through the tracer function.

In any case you can find it at https://github.com/mumme74/FreeCAD/tree/editor_fixes

Regards
Fredrik Johansson
Attachments
screen_frecad-2017-04-17 20-50-17.png
screen_frecad-2017-04-17 20-50-17.png (444.74 KiB) Viewed 4513 times
Last edited by Kunda1 on Sun Jan 03, 2021 8:57 pm, edited 1 time in total.
Reason: Project forked by @ferranpujolcamins
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

Nice!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Python debugger, python editor

Post by chrisb »

Thanks for that work! It is a big step forward!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Python debugger, python editor

Post by triplus »

It looks interesting!
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Python debugger, python editor

Post by easyw-fc »

mumme wrote:Hi!

Just to let you know...
thx so much! Looking forward to see it merged ;)

Maurice
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

Any plans for tab completion?
(X-post https://forum.freecadweb.org/viewtopic.php?f=10&t=22029 )
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

Reference: issue #069 - python debugger/editor
&
issue #573 - Macro editor feature requests

Edit: added 573 and ticket titles
Last edited by Kunda1 on Sat Apr 29, 2017 12:57 pm, edited 1 time in total.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

mumme wrote: The end goal is of course to have this patch merged, although it certainly isn't there yet.

I managed to make the debugger work on my Linux machine (with some bugs of course).
It currently only works with one file and cant trap events.
I'm not sure really why events doesn't gets routed through the tracer function.

In any case you can find it at https://github.com/mumme74/FreeCAD/tree/editor_fixes
What bugs are you encountering?
Can u start an issue queue so if others want to jump in they can and report or fix said issues?
Are you using any 3rd party libs?
Does the console support tab completions like in an IDE?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Python debugger, python editor

Post by Kunda1 »

Please keep us posted!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mumme
Posts: 35
Joined: Sun Jun 21, 2015 4:52 pm

Re: Python debugger, python editor

Post by mumme »

Kunda1 wrote:Any plans for tab completion?
(X-post https://forum.freecadweb.org/viewtopic.php?f=10&t=22029 )
Hi,
Sorry for the late response, is currently busy with other stuff (real life commitments).

Regarding tab completion, I thought about improving code completion/documentation tooltips, I haven't realy got my head around that how just yet.

Autoindent in editor should work though.
What bugs are you encountering?
*Some strange sementation faults on close,
*events from Pyside dosent work
*debugging into function/method in another file isn't ready yet
Can u start an issue queue so if others want to jump in they can and report or fix said issues?
Hum yes I suppose I could, though I must warn you that my free time for coding isnt that predictable. It might take a long time between coding stints.
Are you using any 3rd party libs?
Not yet, was thinking about using one for the code introspection.
Does the console support tab completions like in an IDE?
I haven't really done any changes to the console? (other than parenthesis matching, which is inherited fixes for code editor)
Or perhaps I misunderstood what you meant?
Post Reply