Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apptools.logger quality agent needs a Qt UI #137

Open
corranwebster opened this issue Sep 27, 2020 · 2 comments
Open

Apptools.logger quality agent needs a Qt UI #137

corranwebster opened this issue Sep 27, 2020 · 2 comments

Comments

@corranwebster
Copy link
Contributor

The apptools.logger.agent code is currently Wx-specific. We should either make the dialog use TraitsUI or write a Qt equivalent.

@rahulporuri rahulporuri added this to Sprint 3 : Nov 2 - Nov 13 2020 in Enthought OSS Q4 2020 Nov 2, 2020
@rahulporuri rahulporuri moved this from Sprint 3 : Nov 2 - Nov 13 2020 to Sprint 4 : Nov 16 - Nov 27 2020 in Enthought OSS Q4 2020 Nov 16, 2020
@aaronayres35
Copy link
Contributor

FTR, it seems the quality agent is not currently working with wxPython4:
python etstool.py install
edm shell -e apptools-test-3.6
pip install wxPython
I then ran this script:

from pyface.api import GUI
from apptools.logger.agent.quality_agent_view import QualityAgentView

def main():
    gui = GUI()

    agent = QualityAgentView()
    agent.open()

    gui.start_event_loop()

if __name__ == '__main__':
    main()

and saw this error:

Traceback (most recent call last):
  File "junk.py", line 13, in <module>
    main()
  File "junk.py", line 8, in main
    agent.open()
  File "/Users/aayres/.edm/envs/apptools-test-3.6/lib/python3.6/site-packages/pyface/i_dialog.py", line 164, in open
    self._create()
  File "/Users/aayres/.edm/envs/apptools-test-3.6/lib/python3.6/site-packages/pyface/i_dialog.py", line 185, in _create
    self._create_contents(self.control)
  File "/Users/aayres/.edm/envs/apptools-test-3.6/lib/python3.6/site-packages/pyface/ui/wx/dialog.py", line 116, in _create_contents
    dialog_area = self._create_dialog_area(parent)
  File "/Users/aayres/Desktop/apptools/apptools/logger/agent/quality_agent_view.py", line 73, in _create_dialog_area
    error_panel = self._create_error_panel(panel)
  File "/Users/aayres/Desktop/apptools/apptools/logger/agent/quality_agent_view.py", line 135, in _create_error_panel
    border=5,
wx._core.wxAssertionError: C++ assertion "(m_flag & SIZER_FLAGS_MASK) == m_flag" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/sizer.cpp(215) in wxSizerItem(): invalid flag: not within SIZER_FLAGS_MASK

@aaronayres35
Copy link
Contributor

FTR, it seems the quality agent is not currently working with wxPython4:

Moreover, Im trying to get it to work in mayavi running mayavi2 in this environment:

(mayavi_demo)~/Desktop/mayavi aayres  (master) $ edm list
# Packages in environment 'mayavi_demo'
#  prefix: '/Users/aayres/.edm/envs/mayavi_demo'
appdirs            1.4.3-1     enthought/free
apptools           4.4.0-10    enthought/free
configobj          5.0.6-2     enthought/free
distribute_remove  1.0.0-4     enthought/free
eam                1.1.0-1     enthought/free
eam_mayavi_app     1.0.2-1     enthought/free
enum34             1.1.6-1     enthought/free
envisage           4.7.0-1     enthought/free
libxml2            2.9.4-1     enthought/free
libxslt            1.1.28-7    enthought/free
mayavi             4.5.0-7     enthought/free
mkl                2018.0.3-1  enthought/free
numpy              1.13.3-4    enthought/free
packaging          16.8-2      enthought/free
pyface             6.0.0-1     enthought/free
pygments           2.2.0-1     enthought/free
pyparsing          2.2.0-1     enthought/free
setuptools         38.2.5-1    enthought/free
six                1.10.0-1    enthought/free
traits             4.6.0-1     enthought/free
traitsui           6.0.0-1     enthought/free
vtk                7.0.0-2     enthought/free
wxpython           3.0.2.0-7   enthought/free

The LoggerView seems to work fine:

Screen Shot 2020-11-25 at 2 17 05 PM

However, the QualityAgentView is only used here:

if self.service.preferences.enable_agent:
dialog = QualityAgentView(msg=msg, service=self.service)

So, I click Tools->Preferences->Logger starting from the top menu bar, and then I click the checkbox labelled "Enable quality agent".

The above code where the QualityAgentView is defined in located in the _activated_changed method, so to trigger that I double click a log shown in the LoggerView. When I do that an Error occurs, just like the ones I encountered with wxPython4 as described in the above comment. Conveniently enough the LoggerView catches and records those errors in the displayed table (so trying to interact with the LoggerView is just populating it with even more errors).

ERROR|2020-11-25 14:23:26,125|Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: None, new value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">">">">, new value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">, new value: <LogRecord: traits, 40, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py, 238, "Exception occurred in traits notification handler for object: <apptools.logger.plugin.view.logger_view.LoggerView object at 0x126fa24d0>, trait: activated, old value: None, new value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">">">">, new value: <LogRecord: pyface.ui.wx.workbench.editor_set_structure_handler, 30, /Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/workbench/editor_set_structure_handler.py, 78, "could not restore editor [%s]">">">
Traceback (most recent call last):
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/traits/trait_notifiers.py", line 340, in __call__
    self.handler( *args )
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/apptools/logger/plugin/view/logger_view.py", line 168, in _activated_changed
    dialog.open()
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/i_dialog.py", line 168, in open
    self._create()
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/i_dialog.py", line 189, in _create
    self._create_contents(self.control)
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/pyface/ui/wx/dialog.py", line 122, in _create_contents
    dialog_area = self._create_dialog_area(parent)
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/apptools/logger/agent/quality_agent_view.py", line 74, in _create_dialog_area
    error_panel = self._create_error_panel(panel)
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/apptools/logger/agent/quality_agent_view.py", line 134, in _create_error_panel
    sizer.Add(label2, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.CLIP_CHILDREN, border=5)
  File "/Users/aayres/.edm/envs/mayavi_demo/lib/python2.7/site-packages/wx/_core.py", line 14457, in Add
    return _core_.Sizer_Add(*args, **kwargs)
PyAssertionError: C++ assertion "(m_flag & SIZER_FLAGS_MASK) == m_flag" failed at /Users/vagrant/workspace/Buildsystem/test/pisi/tmp/wxPython-3.0.2.0-7/work/wxPython-src-3.0.2.0/src/common/sizer.cpp(167) in wxSizerItem(): invalid flag: not within SIZER_FLAGS_MASK

@rahulporuri rahulporuri moved this from Sprint 4 : Nov 16 - Nov 27 2020 to Sprint backlog in Enthought OSS Q4 2020 Dec 14, 2020
@rahulporuri rahulporuri removed this from Sprint backlog in Enthought OSS Q4 2020 Jan 5, 2021
@rahulporuri rahulporuri added this to To be considered in Enthought OSS Q1 2021 via automation Jan 5, 2021
@rahulporuri rahulporuri removed this from To be considered in Enthought OSS Q1 2021 Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants