#2559 BLOC Trial-2: failure copying an object to a removable device

Zarro Boogs per Child bugtracker at laptop.org
Sat Jul 28 06:58:28 EDT 2007


#2559: failure copying an object to a removable device
-----------------------+----------------------------------------------------
 Reporter:  tomeu      |       Owner:  bcsaller
     Type:  defect     |      Status:  new     
 Priority:  blocker    |   Milestone:  Trial-2 
Component:  datastore  |     Version:          
 Keywords:             |    Verified:  0       
-----------------------+----------------------------------------------------
 When copying an entry to an inplace mountpoint, the new file is created in
 the fs, but the entry has no filename associated.

 This should help finding the cause:

 {{{
 >>> import dbus
 >>> import dbus.glib
 >>> import os
 >>> import time

 >>> DS_DBUS_SERVICE = "org.laptop.sugar.DataStore"
 >>> DS_DBUS_INTERFACE = "org.laptop.sugar.DataStore"
 >>> DS_DBUS_PATH = "/org/laptop/sugar/DataStore"

 >>> _bus = dbus.SessionBus()
 >>> _data_store = dbus.Interface(_bus.get_object(DS_DBUS_SERVICE,
 DS_DBUS_PATH), DS_DBUS_INTERFACE)

 Create an object with some properties but no file.
 >>> props = {'activity_id':
 dbus.String(u'461c7467f9ef6478b205a687579843fc36a98e7a'),
 'title_set_by_user': '0', 'ctime': '2007-07-28T11:57:57.909689', 'title':
 'Google News', 'mtime': '2007-07-28T11:58:22.460331', 'keep': '0', 'icon-
 color': '#00EA11,#00588C', 'activity': 'org.laptop.WebActivity',
 'mime_type': 'text/plain'}
 >>> uid = _data_store.create(props, '')

 Create a file with some JSON content.
 >>> file_name = os.path.join('/tmp', str(time.time()))
 >>> f = open(file_name, 'w')
 >>>
 f.write('{"history":[{"url":"http://www.google.com/","title":"Google"},{"url":"http://news.google.com/nwshp?tab=wn","title":"Google
 News"}]}')
 >>> f.close()

 Assign this file to the previously created object.
 >>> _data_store.update(uid, props, file_name)

 Mount inplace a pen drive.
 >>> mount_id = _data_store.mount('inplace:/media/46A5-F302',
 dict(title='pen drive'))

 Copy the object we just created in the main mount point to the pen drive.
 >>> props = _data_store.get_properties(uid)
 >>> file_name = _data_store.get_filename(uid)
 >>> props['mountpoint'] = mount_id
 >>> uid2 = _data_store.create(props, file_name)

 Test the file name related to the new copy.
 >>> _data_store.get_filename(uid2)

 Problem: the path returned is empty.
 }}}

-- 
Ticket URL: <https://dev.laptop.org/ticket/2559>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list