[Bugs] #4380 sugar NORM: Journal: when the documents path can not be retrieved, Palettes can not be displayed, detail view does not work correctly

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Tue Jan 15 02:47:35 EST 2013


#4380: Journal: when the documents path can not be retrieved, Palettes can not be
displayed, detail view does not work correctly
-----------------------+----------------------------------------------------
    Reporter:  erikos  |          Owner:  erikos     
        Type:  defect  |         Status:  new        
    Priority:  Normal  |      Milestone:  0.98       
   Component:  sugar   |        Version:  0.98.x     
    Severity:  Major   |       Keywords:             
Distribution:  OLPC    |   Status_field:  Unconfirmed
-----------------------+----------------------------------------------------
 Today I have seen the following: In the Journal I was not able to reveal a
 Palette by hovering or right clicking on one of the icons, nor the detail
 view of any entry had any information about the entry.

 In the logs I found:

 {{{
 Traceback (most recent call last):
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palettewindow.py", line 1414, in
 __motion_notify_ev
 ent_cb
     self.notify_mouse_enter()
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palettewindow.py", line 965, in
 notify_mouse_enter
     self._ensure_palette_exists()
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palettewindow.py", line 960, in
 _ensure_palette_exi
 sts
     palette = self.parent.create_palette()
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/jarabe/journal/listview.py", line 656, in create_palette
     palette = ObjectPalette(metadata, detail=True)
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/jarabe/journal/palettes.py", line 102, in __init__
     copy_menu = CopyMenu(metadata)
   File "/home/erikos/new-sugar-build/install/lib/python2.7/site-
 packages/jarabe/journal/palettes.py", line 228, in __init__
     if not self._metadata['uid'].startswith(documents_path):
 TypeError: startswith first arg must be str, unicode, or tuple, not
 NoneType
 }}}

 It looks like the path to the documents folder can not be retrieved. We
 could be more defensive here, for example:

 {{{
 diff --git a/src/jarabe/journal/palettes.py
 b/src/jarabe/journal/palettes.py
 index 200240f..3d7adbd 100644
 --- a/src/jarabe/journal/palettes.py
 +++ b/src/jarabe/journal/palettes.py
 @@ -225,7 +225,8 @@ class CopyMenu(Gtk.Menu):
              journal_menu.show()

          documents_path = model.get_documents_path()
 -        if not self._metadata['uid'].startswith(documents_path):
 +        if documents_path and \
 +                not self._metadata['uid'].startswith(documents_path):
              documents_menu = VolumeMenu(self._metadata, _('Documents'),
                                          documents_path)
              documents_menu.set_image(Icon(icon_name='user-documents',
 }}}

 We have to check now, why the documents path can not be retrieved.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4380>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list