Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3888 closed defect (fixed)

Journal Listview BuddyPalette: traceback

Reported by: erikos Owned by: manuq
Priority: Urgent Milestone:
Component: Sugar Version: 0.97.x
Severity: Major Keywords: regression, r+
Cc: erikos Distribution/OS: Fedora
Bug Status: Unconfirmed

Description

Traceback (most recent call last):
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 1216, in __motion_notify_event_cb
    self.notify_mouse_enter()
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 910, in notify_mouse_enter
    self._ensure_palette_exists()
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 905, in _ensure_palette_exists
    palette = self.parent.create_palette()
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/jarabe/journal/listview.py", line 668, in create_palette
    if row[self._model_column_index] is not None:
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 1136, in __getitem__
    return self.model.get_value(self.iter, key)
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: unknown type (null)

pygtk-doc: http://www.pygtk.org/docs/pygtk/class-pygtktreemodelrow.html

Attachments (2)

0001-Journal-list-call-do_get_value-directly-to-get-the-b.patch (1.2 KB) - added by manuq 10 years ago.
Workaround patch.
0001-Change-Journal-model-to-make-the-buddy-icons-work.patch (5.7 KB) - added by manuq 10 years ago.
Change the model to fix the icon in the Jounal list view

Download all attachments as: .zip

Change History (17)

comment:1 Changed 10 years ago by manuq

  • Cc manuq added

comment:2 Changed 10 years ago by manuq

  • Owner changed from erikos to manuq
  • Status changed from new to assigned

comment:3 Changed 10 years ago by manuq

The bug is in CellRendererBuddy create_palette method, fails for column indexes 9 and 11 which are COLUMN_BUDDY_* in listmodel.py . It is getting null.

comment:4 Changed 10 years ago by manuq

Another traceback, this time moving the mouse around a Journal entry from a shared activity.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 1279, in __motion_notify_event_cb
    self.notify_mouse_enter()
  File "/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 929, in notify_mouse_enter
    self._ensure_palette_exists()
  File "/usr/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 924, in _ensure_palette_exists
    palette = self.parent.create_palette()
  File "/usr/lib/python2.7/site-packages/jarabe/journal/listview.py", line 679, in create_palette
    nick, xo_color = row[self._model_column_index]
ValueError: too many values to unpack

comment:5 Changed 10 years ago by manuq

  • Keywords regression added
  • Priority changed from Unspecified by Maintainer to Urgent

comment:6 Changed 10 years ago by manuq

Our custom TreeModel do_get_value method is returning the right output for the buddies column. It returns:

  1. None if there is no buddy
  2. (buddy-name, buddy-color) if the buddy for the column exist

However in the create_palette method of CellRendererBuddy we get the first traceback for case 1. And only the buddy-name for the case 2, that's the why of the "too many values to unpack".

Going into pygobjact code we can see that the row[self._model_column_index] internally calls an override, which calls the get_value of the custom model, so we can change:

-        if row[self._model_column_index] is not None:
-            nick, xo_color = row[self._model_column_index]
+        if row.model.get_value(row.iter, self._model_column_index) is not None:
+            nick, xo_color = row.model.get_value(row.iter, self._model_column_index)

That gives us the same bug. But turns out that replacing get_value by do_get_value fixes it:

-        if row[self._model_column_index] is not None:
-            nick, xo_color = row[self._model_column_index]
+        if row.model.do_get_value(row.iter, self._model_column_index) is not None:
+            nick, xo_color = row.model.do_get_value(row.iter, self._model_column_index)

With the latter change the tracebacks are gone and I can see the palette for a Journal entry that was shared. It has the correct buddy color and name.

Changed 10 years ago by manuq

Workaround patch.

Changed 10 years ago by manuq

Change the model to fix the icon in the Jounal list view

comment:7 Changed 10 years ago by manuq

The proposed patch makes the buddy icon in the list visible too. Unlike the workaround, that only fixed the icon inside the palette.

comment:8 Changed 10 years ago by manuq

Still there is a drawback, all rows display the same icon when the first one is displayed.

comment:9 Changed 10 years ago by manuq

  • Cc erikos added; manuq removed
  • Keywords r? added

comment:10 Changed 10 years ago by manuq

  • Keywords r+ olpc-test-pending added; r? removed
  • Resolution set to fixed
  • Status changed from assigned to closed

Filed upstream bug: https://bugzilla.gnome.org/show_bug.cgi?id=689277

Pushed the workaround 9e494ef0 .

comment:11 Changed 10 years ago by manuq

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to track the upstream bug.

comment:12 Changed 10 years ago by manuq

  • Milestone changed from 0.98 to 1.0

comment:13 Changed 10 years ago by greenfeld

  • Keywords olpc-test-pending removed

Buddy icons work in the journal view (as well as the Network view) for shared activities in OLPC 13.1.0 os20/Sugar 0.98.2.

comment:14 Changed 9 years ago by dnarvaez

  • Resolution set to fixed
  • Status changed from reopened to closed

Seems good to close since we have a workaround.

comment:15 Changed 9 years ago by dnarvaez

  • Milestone 1.0 deleted

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.