We have this code in many places, I found it in the Distance activity and bitfrost updater. May be is a good idea inhibit suspend when is displayed the neighborhood view also. Can we have a unique class like PowerManager or anything like that? Regards
Gonzalo On Thu, Sep 16, 2010 at 8:23 PM, James Cameron <qu...@laptop.org> wrote: > On Thu, Sep 16, 2010 at 05:38:29PM -0400, Martin Langhoff wrote: > > 2 - hack the Tubes/Telepathy stack to _prevent sleep_ while an actual > > collaboration session is running > > This might help. Once an activity is shared, the laptop stays awake > until the activity is stopped. > > (sugar-toolkit.git) > --- a/src/sugar/activity/activity.py > +++ b/src/sugar/activity/activity.py > @@ -916,6 +916,14 @@ class Activity(Window, gtk.Container): > self._share_id = self._pservice.connect("activity-shared", > self.__share_cb) > self._pservice.share_activity(self, private=private) > + # inhibit suspend during sharing > + path = '/var/run/powerd-inhibit-suspend/%s' % os.getpid() > + try: > + fd = open(path, 'w') > + except IOError: > + pass > + else: > + fd.close() > > def _show_keep_failed_dialog(self): > alert = Alert() > > -- > James Cameron > http://quozl.linux.org.au/ > _______________________________________________ > Devel mailing list > Devel@lists.laptop.org > http://lists.laptop.org/listinfo/devel >
_______________________________________________ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel