Skip to content

Add option for enable gui event loop when not using matplotlib - #787

Closed
chubei-oppen wants to merge 1 commit into
microsoft:mainfrom
chubei-oppen:enable_gui_event_loop
Closed

chubei-oppen wants to merge 1 commit into
microsoft:mainfrom
chubei-oppen:enable_gui_event_loop

Conversation

@chubei-oppen

Copy link
Copy Markdown
Contributor

Closes #782

@ghost

Deleted user (ghost) commented Nov 18, 2021 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.


if 'ENABLE_GUI_EVENT_LOOP' in debug_options:
self.enable_gui_event_loop = debug_options.get('ENABLE_GUI_EVENT_LOOP')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit shouldn't be necessary - debugOptions is a legacy property for boolean flags in debug config that we had before deciding to just use separate boolean properties; it is really only kept for backwards compatibility.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering what those optoins are for... Removed in f07013d

@fabioz

Copy link
Copy Markdown
Collaborator

chubei-oppen I was thinking that in the current way, to get it to work users would need to do additional work (to call something as: pydevd_ipython.inputhook.enable_gui('qt5') or pydevd_ipython.inputhook.set_inputhook(callback)) and if matplotlib is indeed imported afterwards it'd override that value...

So, what do you think about making guiEventLoop a string and if it matches matplotlib (default), nothing would change, otherwise one of the gui constants in pydevd_ipython.inputhook would be expected, then it'd call pydevd_ipython.inputhook.enable_gui with that constant, but if it still doesn't match it'd be expected to map to a callable which could be then be imported/set in pydevd_ipython.inputhook.set_inputhook.

Does that make sense?

Also, note that if that setting is not matplotlib, init_matplotlib_support should be a no-op (so that we don't have the override issue).

@chubei-oppen

Copy link
Copy Markdown
Contributor Author

Fabio Zadrozny (@fabioz) Sounds good. I'll find time later for the implementaion.

@chubei-oppen

Copy link
Copy Markdown
Contributor Author

Fabio Zadrozny (@fabioz) I force pushed the new implementation.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@fabioz

Copy link
Copy Markdown
Collaborator

It seems good to me, but I want to do some additional manual testing before merging (I'm finishing another issue related to gevent and as soon as I finish that I'll do the final checks/integrate this pull request, sorry for the delay here...)

@fabioz

Fabio Zadrozny (fabioz) commented Dec 3, 2021 •

Copy link
Copy Markdown
Collaborator

Closing in favor of #800 (which includes the changes here and has some additional fixes/tests on top of it).

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

Labels

None yet

3 participants