Update.1 activities download script

Tomeu Vizoso tomeu at tomeuvizoso.net
Mon Mar 17 12:22:29 EDT 2008


On Mon, Mar 17, 2008 at 4:53 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On Mar 17, 2008, at 14:48 , Chris Hager wrote:
>
>  > 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/
>
>  Err, the point of my script is to download activities that are deleted
>  from /usr/share/activities once you upgrade to update.1-699 or later.
>  There are no more pre-installed activities (except for the Journal).
>
>
>  >> 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]] :)
>
>
>  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
term:

http://dev.laptop.org/git?p=sugar;a=blob;f=src/main.py;h=e78570769e8138c827e04c1a6af820c6ce712955;hb=HEAD#l53

Perhaps in the xo you could rely on this hardcoded value?

os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path=/tmp/olpc-session-bus'

Tomeu



More information about the Devel mailing list