[Bugs] #3888 sugar URGE: Journal Listview BuddyPalette: traceback

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Nov 22 13:07:55 EST 2012


#3888: Journal Listview BuddyPalette: traceback
-----------------------+----------------------------------------------------
    Reporter:  erikos  |          Owner:  manuq      
        Type:  defect  |         Status:  assigned   
    Priority:  Urgent  |      Milestone:  0.98       
   Component:  sugar   |        Version:  0.97.x     
    Severity:  Major   |       Keywords:  regression 
Distribution:  Fedora  |   Status_field:  Unconfirmed
-----------------------+----------------------------------------------------

Comment(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
 [http://git.gnome.org/browse/pygobject/tree/gi/overrides/Gtk.py#n1132
 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.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/3888#comment:6>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list