Merge lp:~dobey/ubuntuone-client/disable-inhibit into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 1329
Merged at revision: 1328
Proposed branch: lp:~dobey/ubuntuone-client/disable-inhibit
Merge into: lp:ubuntuone-client
Diff against target: 88 lines (+3/-15)
2 files modified
tests/status/test_aggregator.py (+3/-2)
ubuntuone/status/aggregator.py (+0/-13)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/disable-inhibit
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+127311@code.launchpad.net

Commit message

Dsable the session inhibitor to prevent bug #737620 from happening.

To post a comment you must log in.
1329. By dobey

Fix whitespace

Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/status/test_aggregator.py'
2--- tests/status/test_aggregator.py 2012-09-26 20:20:51 +0000
3+++ tests/status/test_aggregator.py 2012-10-01 15:53:44 +0000
4@@ -39,6 +39,7 @@
5
6 from contrib.testing.testcase import BaseTwistedTestCase
7 from ubuntuone.devtools.handlers import MementoHandler
8+from ubuntuone.devtools.testcases import skipTest
9 from ubuntuone.status import aggregator
10 from ubuntuone.status.notification import AbstractNotification
11 from ubuntuone.status.messaging import AbstractMessaging
12@@ -576,7 +577,6 @@
13 """Initialize this test instance."""
14 yield super(ProgressBarTestCase, self).setUp()
15 self.patch(aggregator, "UbuntuOneLauncher", FakeLauncher)
16- self.patch(aggregator.session, "Inhibitor", FakeInhibitor)
17 self.clock = PatchedClock()
18 self.bar = aggregator.ProgressBar(clock=self.clock)
19 self.addCleanup(self.bar.cleanup)
20@@ -662,6 +662,7 @@
21 self.assertFalse(self.bar.visible)
22 self.assertFalse(self.bar.launcher.progress_visible)
23
24+ @skipTest('Inhibitor is disabled to prevent bug #737620')
25 @defer.inlineCallbacks
26 def test_progress_made_inhibits_logout_suspend(self):
27 """Suspend and logout are inhibited when the progressbar is shown."""
28@@ -670,6 +671,7 @@
29 inhibitor = yield self.bar.inhibitor_defer
30 self.assertEqual(inhibitor.flags, expected)
31
32+ @skipTest('Inhibitor is disabled to prevent bug #737620')
33 @defer.inlineCallbacks
34 def test_completed_uninhibits_logout_suspend(self):
35 """Suspend and logout are uninhibited when all has completed."""
36@@ -1291,7 +1293,6 @@
37 self.patch(aggregator, "ToggleableNotification",
38 FakeNotificationSingleton())
39 self.patch(aggregator, "UbuntuOneLauncher", FakeLauncher)
40- self.patch(aggregator.session, "Inhibitor", FakeInhibitor)
41 clock = PatchedClock()
42 self.status_frontend = aggregator.StatusFrontend(clock=clock)
43 self.aggregator = self.status_frontend.aggregator
44
45=== modified file 'ubuntuone/status/aggregator.py'
46--- ubuntuone/status/aggregator.py 2012-09-26 20:20:51 +0000
47+++ ubuntuone/status/aggregator.py 2012-10-01 15:53:44 +0000
48@@ -43,7 +43,6 @@
49 from ubuntuone.status.logger import logger
50 from ubuntuone.platform import (
51 notification,
52- session,
53 sync_menu
54 )
55 from ubuntuone.platform.messaging import Messaging
56@@ -533,7 +532,6 @@
57 progress = 0.0
58 updates_delay = 0.1
59 timer = None
60- inhibitor_defer = None
61
62 def __init__(self, clock=reactor):
63 """Initialize this instance."""
64@@ -563,9 +561,6 @@
65 self.visible = True
66 self.launcher.show_progressbar()
67 logger.debug("progressbar shown")
68- if self.inhibitor_defer is None:
69- self.inhibitor_defer = session.inhibit_logout_suspend(
70- FILE_SYNC_IN_PROGRESS)
71 if not self.timer:
72 self.timer = Timer(self.updates_delay, clock=self.clock)
73 self.timer.addCallback(self._timeout)
74@@ -576,14 +571,6 @@
75 self.visible = False
76 self.launcher.hide_progressbar()
77 logger.debug("progressbar hidden")
78- if self.inhibitor_defer is not None:
79-
80- def inhibitor_callback(inhibitor):
81- """The inhibitor was found, so cancel it."""
82- self.inhibitor_defer = None
83- return inhibitor.cancel()
84-
85- self.inhibitor_defer.addCallback(inhibitor_callback)
86
87
88 class FinalStatusBubble(object):

Subscribers

People subscribed via source and target branches