)
iface = dbus.Interface(remote_object, 'org.marcoz.feedingit')
iface.StopUpdate()
-
+
+ def increase_download_parallelism(self):
+ # The system has been idle for a while. Enable parallel
+ # downloads.
+ JobManager().num_threads = 4
+ gobject.source_remove (self.increase_download_parallelism_id)
+ del self.increase_download_parallelism_id
+ return False
+
+ def system_inactivity_ind(self, idle):
+ # The system's idle state changed.
+ if (self.am_idle and idle) or (not self.am_idle and not idle):
+ # No change.
+ return
+
+ if not idle:
+ if hasattr (self, 'increase_download_parallelism_id'):
+ gobject.source_remove (self.increase_download_parallelism_id)
+ del self.increase_download_parallelism_id
+ else:
+ self.increase_download_parallelism_id = \
+ gobject.timeout_add_seconds(
+ 60, self.increase_download_parallelism)
+
+ if not idle:
+ JobManager().num_threads = 1
+
+ self.am_idle = idle
+
def late_init(self):
self.dbusHandler = ServerObject(self)
self.updateDbusHandler = UpdateServerObject(self)
jm = JobManager()
jm.stats_hook_register (self.job_manager_update,
run_in_main_thread=True)
+ jm.num_threads = 1
+ self.am_idle = False
JobManager(True)
+ import dbus
+ bus = dbus.SystemBus()
+ proxy = bus.get_object('com.nokia.mce',
+ '/com/nokia/mce/signal')
+ iface = dbus.Interface(proxy, 'com.nokia.mce.signal')
+ iface.connect_to_signal('system_inactivity_ind',
+ self.system_inactivity_ind)
+
def button_markAll(self, button):
for key in self.listing.getListOfFeeds():
feed = self.listing.getFeed(key)