File: source_simple-scan.py

package info (click to toggle)
simple-scan 46.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,388 kB
  • sloc: xml: 133; sh: 67; python: 29; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 925 bytes parent folder | download | duplicates (4)
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
'''apport package hook for simple-scan

(c) 2010 Canonical Ltd.
Author: Robert Ancell <robert.ancell@canonical.com>
'''

import os.path
from apport.hookutils import *

LOG_FILE = os.path.expanduser('~/.cache/simple-scan/simple-scan.log')
driver_packages = ['libsane', 'libsane1', 'libsane-extras', # SANE drivers
                   'hplip', 'hpoj', # HP drivers
                   'iscan', 'iscan-data', 'iscan-network-nt', # Epson drivers
                   'brscan', 'brscan2', 'brscan3', 'brscan4' # Brother drivers
                  ]


def add_info(report):
    attach_hardware(report)
    versions = ''
    for package in driver_packages:
        try:
            version = packaging.get_version(package)
        except ValueError:
            version = 'N/A'
        versions += '%s %s\n' % (package, version)
    report['DriverPackageVersions'] = versions
    attach_file_if_exists(report, LOG_FILE, 'SimpleScanLog')