Ejemplo n.º 1
0
 def test_inhibit_call(self):
     """Test the inhibit call."""
     fakeinhibitor = self.register_fakeserver(
         session.SESSION_MANAGER_BUSNAME, session.SESSION_MANAGER_PATH,
         FakeGnomeSessionManagerInhibitor)
     inhibit_result = yield session.inhibit_logout_suspend("fake reason")
     self.assertNotEqual(None, inhibit_result)
     result = fakeinhibitor.IsInhibited(session.INHIBIT_LOGGING_OUT)
     self.assertTrue(result)
     result = fakeinhibitor.IsInhibited(session.INHIBIT_SUSPENDING_COMPUTER)
     self.assertTrue(result)
Ejemplo n.º 2
0
 def set_progress(self, progress):
     """Steps amount changed. Set up a timer if there isn't one ticking."""
     self.progress = progress
     if not self.visible:
         self.visible = True
         self.launcher.show_progressbar()
         logger.debug("progressbar shown")
         if self.inhibitor_defer is None:
             self.inhibitor_defer = session.inhibit_logout_suspend(
                                                      FILE_SYNC_IN_PROGRESS)
     if not self.timer:
         self.timer = Timer(self.updates_delay, clock=self.clock)
         self.timer.addCallback(self._timeout)