On Mon, May 19, 2008 at 9:55 AM, Martin Langhoff
<[EMAIL PROTECTED]> wrote:
> n Mon, May 19, 2008 at 7:20 PM, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
>> Do you think this would be enough?
>
> That'll be *perfect* for this :-)
Ok, then something like this should do the job:
---
import sys
import os
import unittest
import time
import tempfile
import shutil
from datetime import datetime
import dbus
DS_DBUS_SERVICE = "org.laptop.sugar.DataStore"
DS_DBUS_INTERFACE = "org.laptop.sugar.DataStore"
DS_DBUS_PATH = "/org/laptop/sugar/DataStore"
bus = dbus.SessionBus()
proxy = bus.get_object(DS_DBUS_SERVICE, DS_DBUS_PATH)
data_store = dbus.Interface(proxy, DS_DBUS_INTERFACE)
for i in range(0, 10):
results, count = data_store.find({}, ['uid'])
print count
for props in results:
props2 = data_store.get_properties(props['uid'])
data_store.create(props2, '', True)
---
If you run it from an ssh session, you'll need to
export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/olpc-session-bus
And if you kill the journal first, it will be much faster because it
won't be burning cpu cycles updating the UI.
Good luck,
Tomeu
_______________________________________________
Devel mailing list
[email protected]
http://lists.laptop.org/listinfo/devel