diff options
author | Didier Raboud <odyx@debian.org> | 2016-01-04 16:44:52 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2016-01-04 16:44:52 +0100 |
commit | 9e61c3c0f74d2e88ddacf5a802227bdd0eafd522 (patch) | |
tree | e907171de4c0993899bc6ef1dcd135fa50dee0d0 /timedate.py | |
parent | d2347c83fe9fb2053998235b0e81e93dbc888598 (diff) |
Imported Upstream version 2.8.2
Diffstat (limited to 'timedate.py')
-rwxr-xr-x | timedate.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/timedate.py b/timedate.py index f2f4c6b9a..c0084d82e 100755 --- a/timedate.py +++ b/timedate.py @@ -36,7 +36,7 @@ from base.g import * from base.codes import * from base import device, status, utils, pml from prnt import cups -from fax import fax +from fax import faxdevice USAGE = [(__doc__, "", "name", True), ("Usage: timedate.py [PRINTER|DEVICE-URI] [OPTIONS]", "", "summary", True), @@ -118,7 +118,7 @@ for o, a in opts: elif o in ('-p', '--printer'): if a.startswith('*'): - printer_name = cups.getDefault() + printer_name = cups.getDefaultPrinter() else: printer_name = a @@ -157,7 +157,15 @@ if not device_uri and not printer_name: log.error("Error occured during interactive mode. Exiting.") sys.exit(0) -d = fax.FaxDevice(device_uri, printer_name) +try: + d = faxdevice.FaxDevice(device_uri, printer_name) +except Error, e: + if e.opt == ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION: + log.error("Device does not support setting time/date.") + sys.exit(1) + else: + log.error(e.msg) + sys.exit(1) if d.device_uri is None and printer_name: log.error("Printer '%s' not found." % printer_name) |