#4651 NORM Never A: Sugar should make better use of tmp space

Zarro Boogs per Child bugtracker at laptop.org
Mon Nov 5 04:27:08 EST 2007


#4651: Sugar should make better use of tmp space
---------------------+------------------------------------------------------
  Reporter:  tomeu   |       Owner:  tomeu         
      Type:  defect  |      Status:  new           
  Priority:  normal  |   Milestone:  Never Assigned
 Component:  sugar   |     Version:                
Resolution:          |    Keywords:                
  Verified:  0       |  
---------------------+------------------------------------------------------

Comment(by tomeu):

 From #4164. ActivityBundle.get_icon:

 {{{
     # FIXME: this should return the icon data, not a filename, so that
     # we don't need to create a temp file in the zip case
     def get_icon(self):
         """Get the activity icon name"""
         icon_path = os.path.join('activity', self._icon + '.svg')
         if self._unpacked:
             return os.path.join(self._path, icon_path)
         else:
             icon_data = self._get_file(icon_path).read()
             temp_file, temp_file_path = tempfile.mkstemp(self._icon)
             os.write(temp_file, icon_data)
             os.close(temp_file)
             return temp_file_path
 }}}

 In this case, we can easily create a StringIO.StringIO so the svg data is
 kept in RAM, or change the API to return a string with the svg data.

-- 
Ticket URL: <http://dev.laptop.org/ticket/4651#comment:1>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list