Future extensions:
a) we are now able to reliably detect when an activity's main process has
exited. We should take advantage of this to give better feedback on activity
crashes; e.g. by turning the frame's activity-icon into an error icon and by
inserting the activity's log into the datastore so that it appears in the
Journal.
b) in the future, I'd like rainbow to provide more narrow interfaces for
manipulating jails; e.g. for garbage-collecting them, nuking their contents, or
for reusing them. Please consider this an invitation to show me which interfaces
would work best for Sugar.
P.S. - Thanks to Sascha Silbe for testing and for improvements to this patch.
* Remove a race in open_log_file()
* Make open_log_file return a path as well as a file-object so that
Rainbow-launched activities can log to the same path that sugar-launched
ones do.
* Change the call to Rainbow so that it writes to the log-file provided by
open_log_file()
* Define SUGAR_BUNDLE_ID env variable and change the location of the check
for /etc/olpc-security so that Rainbow doesn't have to search for or parse
the activity bundle.
* Remove import statements marked as unnecessary by pylint.
* Fix up some whitespace issues.