Update.1 activities download script
bert at freudenbergs.de
Tue Mar 18 09:57:38 EDT 2008
On Mar 17, 2008, at 17:22 , Tomeu Vizoso wrote:
>>>> And finally, there is a trick in the script so it connects to the
>>>> current Sugar session even if run from the console or via ssh - may
>>>> be useful to somebody:
>>>> if not 'SUGAR_PREFIX' in os.environ:
>>>> """Connect to running Sugar session"""
>>>> cp = ConfigParser()
>>>> os.environ['DBUS_SESSION_BUS_ADDRESS'] = cp.get('Session',
>>> Thanks a lot, this is really useful for me already! Maybe also put
>>> it somewhere in the wiki... [[Programming Tricks]] :)
>> I actually have no idea how evil that snippet really is ;) Wold be
>> nice if some Sugar/DBus expert could comment.
> Don't really know why that file is there, but from this comment from
> the code that creates it, it's not something you can rely in the long
> Perhaps in the xo you could rely on this hardcoded value?
> os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/tmp/olpc-
That is more elegant, thanks. I updated the script.
It now also switches to the olpc user if run as root, is case-
insensitive to the listed activities, and supports excluding
activities (because, e.g., OurStories and XaoS are broken).
Ah, I need to stop working on this ;)
- Bert -
More information about the Devel