diff options
Diffstat (limited to 'debian/source_simple-scan.py')
-rw-r--r-- | debian/source_simple-scan.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/source_simple-scan.py b/debian/source_simple-scan.py new file mode 100644 index 0000000..7d74c50 --- /dev/null +++ b/debian/source_simple-scan.py @@ -0,0 +1,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') |