~ubuntu-branches/ubuntu/wily/blueman/wily

« back to all changes in this revision

Viewing changes to apps/blueman-rfcomm-watcher

  • Committer: Package Import Robot
  • Author(s): Sean Davis
  • Date: 2015-09-07 12:48:18 UTC
  • mfrom: (2.3.11 sid)
  • Revision ID: package-import@ubuntu.com-20150907124818-evulc0mhjotz8q29
Tags: 2.0-1ubuntu1
* Merge from Debian unstable (LP: #1482626). Remaining changes:
  - debian/patches/03_filemanage_fix.patch:
    + Dropped, no longer needed.
  - debian/patches/dhcpclient_priority
  - debian/patches/01_dont_autostart_lxde.patch
    + Refreshed patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
from __future__ import print_function
 
4
from __future__ import division
 
5
from __future__ import absolute_import
 
6
from __future__ import unicode_literals
 
7
 
 
8
from gi.repository import Gio
 
9
from gi.repository import GLib
 
10
import os
 
11
import sys
 
12
 
 
13
from blueman.Functions import set_proc_title
 
14
 
 
15
def on_file_changed(monitor, file, other_file, event_type):
 
16
    if event_type == Gio.FileMonitorEvent.DELETED:
 
17
        loop.quit()
 
18
 
 
19
mon = Gio.File.new_for_path(sys.argv[1]).monitor_file(Gio.FileMonitorFlags.NONE)
 
20
mon.connect('changed', on_file_changed)
 
21
 
 
22
fd = os.open(sys.argv[1], os.O_RDONLY | os.O_NONBLOCK)
 
23
 
 
24
set_proc_title()
 
25
loop = GLib.MainLoop()
 
26
loop.run()