~stolowski/libunity/activate-result

« back to all changes in this revision

Viewing changes to bindings/python/scope-runner-dbus.py

  • Committer: Tarmac
  • Author(s): Michal Hruby
  • Date: 2013-03-28 16:38:05 UTC
  • mfrom: (351.1.3 libunity)
  • Revision ID: tarmac-20130328163805-0g7b96lniptwtkdh
Add support for quitting scopes after being idle for a while.

Approved by Pawel Stolowski, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  scope = scope_module.load_scope()
29
29
  connector = Unity.ScopeDBusConnector.new(scope)
30
30
  connector.export()
31
 
  ml = GLib.MainLoop()
32
 
  ml.run()
 
31
  # add manual handling for SIGTERM, since we don't use GLib.MainLoop
 
32
  # from python it wouldn't be handled properly
 
33
  GLib.unix_signal_add_full(0, 2, lambda x: Unity.ScopeDBusConnector.quit(), None)
 
34
  Unity.ScopeDBusConnector.run()
33
35
 
34
36
if __name__ == "__main__":
35
37
  main (sys.argv)