[GRASS-dev] [GRASS GIS] #3402: g.gui.gmodeler: trying to add command pushes CPU to 100% and provokes freeze

GRASS GIS trac at osgeo.org
Mon Aug 21 09:25:54 PDT 2017


#3402: g.gui.gmodeler: trying to add command pushes CPU to 100% and provokes
freeze
--------------------------+-----------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  major        |  Milestone:  7.2.2
 Component:  wxGUI        |    Version:  svn-trunk
Resolution:               |   Keywords:  gmodeler freeze
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-----------------------------

Comment (by mlennert):

 Replying to [comment:4 annakrat]:
 > what does this give you?
 > {{{
 >   import wx
 >   wx.version()
 > }}}
 >
 > I have '3.0.2.0 gtk2 (classic)'. I just want to make sure it's GTK3, the
 '3' in your packages might refer to wxpython 3, not gtk 3.

 Once again (as always ;-) ) you were right:


 {{{
 >>> import wx
 >>> wx.version()
 '3.0.2.0 gtk2 (classic)'
 }}}

 And looking better than before, I see that the dependency chain of
 packages is:

 python-wxgtk3.0 -> libwxgtk3.0-0v5 -> libgtk2.0-0

 So, definitely gtk2...

 >
 > You can test example OGL in wxpython demo,
 > I suspect there could be a problem related to this. If the problem is in
 the dialog, you could try to remove certain widgets and see if the problem
 persists.
 > I see it creates a long list of modules in the wx.Choice widget, maybe
 that could an issue?

 Commenting out the SearchModuleWidget seems to do the trick:

 {{{
 Index: gui/wxpython/gmodeler/dialogs.py
 ===================================================================
 --- gui/wxpython/gmodeler/dialogs.py    (révision 71421)
 +++ gui/wxpython/gmodeler/dialogs.py    (copie de travail)
 @@ -201,11 +201,11 @@
          self.cmd_prompt.promptRunCmd.connect(self.OnCommand)
          self.cmd_prompt.commandSelected.connect(
              lambda command: self.label.SetValue(command))
 -        self.search = SearchModuleWidget(parent=self.panel,
 +        '''self.search = SearchModuleWidget(parent=self.panel,
                                           model=menuModel.GetModel(),
                                           showTip=True)
          self.search.moduleSelected.connect(
 -            lambda name: self.cmd_prompt.SetTextAndFocus(name + ' '))
 +            lambda name: self.cmd_prompt.SetTextAndFocus(name + ' '))'''
          wx.CallAfter(self.cmd_prompt.SetFocus)

          self.label = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY)
 @@ -249,8 +249,8 @@
          btnSizer.Realize()

          mainSizer = wx.BoxSizer(wx.VERTICAL)
 -        mainSizer.Add(self.search, proportion=0,
 -                      flag=wx.EXPAND | wx.ALL, border=3)
 +        '''mainSizer.Add(self.search, proportion=0,
 +                      flag=wx.EXPAND | wx.ALL, border=3)'''
          mainSizer.Add(cmdSizer, proportion=1,
                        flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
 border=3)
          mainSizer.Add(labelSizer, proportion=1,
 }}}

 I now get a functioning window and when I start entering a module name, I
 get the incremental search, can select a module and add it. Will need to
 test some more.

 Trying to find and test SearchModuleWidget elsewhere in the GUI, I
 stumbled upon another encoding issue: #3405. Could this maybe be linked ?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3402#comment:5>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list