I installed hplip-2.7.7 with --disable-fax-build, because my printer
(LJ3052) doesn't have fax capability.
In this configuration, hp-timedate doesn't work because it uses a fax
device.
Please find attached a patch to allow timedate function with no fax.
J. Ph.
--- timedate.py.orig Wed Aug 8 22:01:36 2007
+++ timedate.py Wed Aug 8 22:04:40 2007
@@ -35,7 +35,7 @@
from base.codes import *
from base import device, status, utils, pml
from prnt import cups
-from fax import fax
+#from fax import fax
USAGE = [(__doc__, "", "name", True),
("Usage: timedate.py [PRINTER|DEVICE-URI] [OPTIONS]", "", "summary", True),
@@ -155,7 +155,7 @@
log.error("Error occured during interactive mode. Exiting.")
sys.exit(0)
-d = fax.FaxDevice(device_uri, printer_name)
+d = device.Device(device_uri, printer_name)
if d.device_uri is None and printer_name:
log.error("Printer '%s' not found." % printer_name)
--- base/device.py.orig Wed Aug 8 22:23:42 2007
+++ base/device.py Wed Aug 8 22:25:32 2007
@@ -28,6 +28,7 @@
import urllib
import StringIO
import httplib
+import struct
# Local
from g import *
@@ -1930,6 +1931,12 @@
log.error("Firmware file '%s' not found." % filename)
return ok
+
+ def setDateAndTime(self):
+ t = time.localtime()
+ p = struct.pack("BBBBBBB", t[0]-2000, t[1], t[2], t[6]+1, t[3], t[4], t[5])
+ log.debug(repr(p))
+ return self.setPML(pml.OID_DATE_AND_TIME, p)
# ********************************** Support classes/functions
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
HPLIP-Devel mailing list
HPLIP-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hplip-devel