[sugar] Update.1 activities download script
Chris Hager
chris
Mon Mar 17 09:48:13 EDT 2008
Sorry for posting twice here before, but somehow I didn't receive any
devel and sugar mails for 2 days... Now seems to work again. :p
I'm just about implementing the script into xo-get, and I was thinking
on how to do it. Either simply integrating it into xo-get.py (xo-get is
a 1-file script), or download it on an 'xo-get upgrade' if it's not
available. This might be smarter, so changes in the upgrade script can
be made without changing xo-get.
Bert Freudenberg wrote:
> ...
>
> To save download time, do something like this first:
>
> cp -a /usr/share/activities/*.activity /home/olpc/Activities
Maybe only make symlinks?
ln -s /usr/share/activities/*.activity /home/olpc/Activities/
> 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()
> cp.read(env.get_profile_path('session.info'))
> os.environ['DBUS_SESSION_BUS_ADDRESS'] = cp.get('Session',
> 'dbus_address')
> dbus.set_default_main_loop(dbus.mainloop.NULL_MAIN_LOOP)
Thanks a lot, this is really useful for me already! Maybe also put it
somewhere in the wiki... [[Programming Tricks]] :)
- Chris
More information about the Sugar-devel
mailing list