Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-17 22:03:59 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-17 22:03:59 (GMT)
commita886b037618b06659e3ddecdbfb0b962134e2a2a (patch)
treede9a10c07b9f6bf1ffef4f90c389737396cd65ea
parentc047ee38cbe7d01726c4d902af9103f7f1e6c4dd (diff)
#1396: Use the bundle path to check if we should suspend on idle. (rwh)
-rw-r--r--NEWS2
-rw-r--r--readactivity.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 28c4e60..b3f4d0c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+* #1396: Use the bundle path to check if we should suspend on idle. (rwh)
+
40
* Fix zoom to width (tomeu), #5866
diff --git a/readactivity.py b/readactivity.py
index c742a42..4db55ea 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -124,7 +124,8 @@ class ReadActivity(activity.Activity):
self.unused_download_tubes = set()
self._want_document = True
- if os.path.exists(os.path.expanduser("~/ebook-enable-sleep")):
+ fname = os.path.join(activity.get_bundle_path(), 'ebook-enable-sleep')
+ if os.path.exists(fname):
try:
bus = dbus.SystemBus()
proxy = bus.get_object(_HARDWARE_MANAGER_SERVICE,
@@ -135,8 +136,12 @@ class ReadActivity(activity.Activity):
self.connect("focus-in-event", self._focus_in_event_cb)
self.connect("focus-out-event", self._focus_out_event_cb)
self.connect("notify::active", self._now_active_cb)
+
+ logging.debug('Suspend on idle enabled')
except dbus.DBusException, e:
_logger.info('Hardware manager service not found, no idle suspend.')
+ else:
+ logging.debug('Suspend on idle disabled')
self.connect("shared", self._shared_cb)