File: source_bluez.py

package info (click to toggle)
bluez 5.85-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,016 kB
  • sloc: ansic: 423,507; python: 4,751; sh: 4,580; makefile: 750; xml: 126
file content (33 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''apport package hook for bluez

(c) 2010 Free Software Foundation
Author:
Baptiste Mille-Mathias <baptistem@src.gnome.org>

'''
from apport.hookutils import *
import re

def add_info(report, ui):
    report['syslog'] = recent_syslog(re.compile(r'bluetooth', re.IGNORECASE))
    attach_hardware(report)
    if command_available('hciconfig'):
        report['hciconfig'] = command_output('hciconfig')
    if command_available('rfkill'):
        report['rfkill'] = command_output(['rfkill','list'])
    if command_available('getfacl'):
        report['getfacl'] = command_output(['getfacl','/dev/rfkill'])

    interesting_modules = ('btusb', 'rfcomm', 'sco', 'bnep', 'l2cap', 'bluetooth')
    interesting_modules_loaded = []

    for line in open('/proc/modules'):
        module = line.split()[0]
        if module in interesting_modules:
            interesting_modules_loaded.append(module)

    if interesting_modules_loaded:
        report['InterestingModules'] = ' '.join(interesting_modules_loaded)