diff options
author | Didier Raboud <odyx@debian.org> | 2016-01-04 16:43:51 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2016-01-04 16:43:51 +0100 |
commit | d2347c83fe9fb2053998235b0e81e93dbc888598 (patch) | |
tree | b0d64153826ed4bccdf888471261464cc0b65483 /timedate.py | |
parent | adcfeaed777a5a8ac231413ec9130705bb042e0a (diff) |
Imported Upstream version 2.7.10
Diffstat (limited to 'timedate.py')
-rwxr-xr-x | timedate.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/timedate.py b/timedate.py index 79a2d981e..f2f4c6b9a 100755 --- a/timedate.py +++ b/timedate.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# (c) Copyright 2003-2006 Hewlett-Packard Development Company, L.P. +# (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # Author: Don Welch # -__version__ = '0.1' +__version__ = '0.2' __title__ = 'Time/Date Utility' __doc__ = "Set the time and date on an HP Officejet." @@ -29,6 +29,7 @@ import sys import re import getopt import struct +import operator # Local from base.g import * @@ -89,7 +90,8 @@ try: 'bus=', ] ) -except getopt.GetoptError: +except getopt.GetoptError, e: + log.error(e.msg) usage() printer_name = None @@ -109,7 +111,7 @@ for o, a in opts: elif o == '--help-man': usage('man') - + elif o == '--help-desc': print __doc__, sys.exit(0) @@ -148,7 +150,7 @@ utils.log_title(__title__, __version__) if not device_uri and not printer_name: try: - device_uri = device.getInteractiveDeviceURI(bus) + device_uri = device.getInteractiveDeviceURI(bus, filter={'fax-type' : (operator.gt, 0)}) if device_uri is None: sys.exit(1) except Error: @@ -165,6 +167,8 @@ if d.device_uri is None and device_uri: log.error("Malformed/invalid device-uri: %s" % device_uri) sys.exit(1) +user_cfg.last_used.device_uri = d.device_uri + try: d.open() except Error: @@ -176,7 +180,7 @@ try: except Error: log.error("An error occured!") - + log.info("") d.close() log.info('Done.') |