Commit b6f7e80d authored by Didier 'OdyX' Raboud's avatar Didier 'OdyX' Raboud

Imported Upstream version 3.12.4

parent 78face2d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
This diff is collapsed.
......@@ -205,13 +205,16 @@ try:
elif align_type == ALIGN_TYPE_LIDIL_DJ_D1600:
maint.AlignType14(d, tui.load_paper_prompt, type10and11and14Align, invalidPen2)
elif align_type == ALIGN_TYPE_LEDM:
maint.AlignType15(d, tui.load_paper_prompt, aioUI2)
elif align_type == ALIGN_TYPE_LEDM_MANUAL:
maint.AlignType16(d, tui.load_paper_prompt, enterAlignmentNumber)
elif align_type == ALIGN_TYPE_LEDM_FF_CC_0:
maint.AlignType17(d, tui.load_paper_prompt, aioUI2)
else:
log.error("Invalid alignment type.")
......
......@@ -296,9 +296,14 @@ def getVSACodes(dev, adapterName):
if params is not None:
try:
severity= params['io:vsacodes-wifi:vsacode-dd:severity']
except:
severity = ""
try:
rule = params['io:vsacodes-wifi:vsacode-wifi:rulenumber']
except KeyError, e:
log.error("Missing response key: %s" % str(e))
# except KeyError, e:
# log.error("Missing response key: %s" % str(e))
except:
rule = ""
ret.append((rule, severity))
return ret
......@@ -362,22 +367,36 @@ def readXmlDataFromURI(dev,URI,xmlRootNode,xmlChildNode,timeout=5):
params,code,elementCount ={},HTTP_ERROR,0
data = format_http_get(URI,0,"")
log.info(data)
dev.openLEDM()
dev.writeLEDM(data)
log.info(data)
response = cStringIO.StringIO()
try:
while dev.readLEDM(1024, response, timeout):
pass
except Error:
dev.closeLEDM()
log.error("Unable to read LEDM Channel")
dev.closeEWS_LEDM()
strResp = str(response.getvalue())
if dev.openLEDM() == -1:
dev.openEWS_LEDM()
dev.writeEWS_LEDM(data)
try:
while dev.readEWS_LEDM(1024, response, timeout):
pass
except Error:
dev.closeEWS_LEDM()
log.error("Unable to read EWS_LEDM Channel")
else:
dev.writeLEDM(data)
#response = cStringIO.StringIO()
try:
while dev.readLEDM(1024, response, timeout):
pass
except Error:
dev.closeLEDM()
log.error("Unable to read LEDM Channel")
#dev.closeEWS_LEDM()
strResp = str(response.getvalue())
#log.error(strResp)
if strResp is not None:
code = get_error_code(strResp)
pos = strResp.find(xmlRootNode,0,len(strResp))
repstr = strResp[pos:].strip()
repstr = filter(lambda c: c not in "\r\t\n", repstr) # To remove formating characters from the received xml
repstr = repstr.rstrip('0') # To remove trailing zero from the received xml
elementCount = repstr.count(xmlChildNode)
try:
params = utils.XMLToDictParser().parseXML(repstr)
......@@ -390,17 +409,30 @@ def readXmlDataFromURI(dev,URI,xmlRootNode,xmlChildNode,timeout=5):
def writeXmlDataToURI(dev,URI,xml,timeout=5):
code = HTTP_ERROR
data = format_http_put(URI,len(xml),xml)
dev.openLEDM()
dev.writeLEDM(data)
data = format_http_put(URI,len(xml),xml)
response = cStringIO.StringIO()
try:
while dev.readLEDM(1000, response, timeout):
pass
except Error:
dev.closeLEDM()
log.error("Unable to read LEDM Channel")
dev.closeLEDM()
if dev.openLEDM() == -1:
dev.openEWS_LEDM()
dev.writeEWS_LEDM(data)
try:
while dev.readEWS_LEDM(1000, response, timeout):
pass
except Error:
dev.closeEWS_LEDM()
log.error("Unable to read EWS_LEDM Channel")
else:
dev.writeLEDM(data)
#response = cStringIO.StringIO()
try:
while dev.readLEDM(1000, response, timeout):
pass
except Error:
dev.closeLEDM()
log.error("Unable to read LEDM Channel")
strResp = str(response.getvalue())
if strResp is not None:
code = get_error_code(strResp)
......
......@@ -207,6 +207,9 @@ EVENT_SCAN_ADF_JAM = 2007
EVENT_SCAN_ADF_DOOR_OPEN = 2008
EVENT_SCAN_CANCEL = 2009
EVENT_SIZE_WARNING = 2010
EVENT_SCAN_ADF_NO_DOCS = 2011
EVENT_SCAN_ADF_MISPICK = 2012
EVENT_SCAN_BUSY = 2013
#end
# fax
......@@ -253,6 +256,11 @@ EVENT_ERROR_DEVICEOPEN_FAILED_ONE_DEVICE_ONLY = 5037
EVENT_ERROR_DEVICEOPEN_FAILED_DEV_NODE_MOVED = 5038
# end
# diagnosis tool codes
EVENT_ADD_PRINTQUEUE = 5501
EVENT_DIAGNOSE_PRINTQUEUE = 5502
#end
# pcard
EVENT_START_PCARD_JOB = 6000
EVENT_END_PCARD_JOB = 6001
......@@ -399,7 +407,7 @@ STATUS_TO_ERROR_STATE_MAP = {
STATUS_DEVICE_UNSUPPORTED : ERROR_STATE_ERROR,
STATUS_PRINTER_CARTRIDGE_MISSING : ERROR_STATE_ERROR,
STATUS_PRINTER_CARTRIDGE_WRONG : ERROR_STATE_ERROR,
STATUS_PRINTER_PRINTHEAD_MISSING : ERROR_STATE_ERROR,
STATUS_PRINTER_PRINTHEAD_MISSING : ERROR_STATE_ERROR,
# The following block are EVENTs because they are only
# recieved as events from hpmud, hp backend, etc.
# i.e., a device does not produce status codes in this range
......@@ -430,6 +438,9 @@ STATUS_TO_ERROR_STATE_MAP = {
EVENT_SCAN_ADF_LOADED : ERROR_STATE_OK,
EVENT_SCAN_CANCEL : ERROR_STATE_OK,
EVENT_SIZE_WARNING : ERROR_STATE_WARNING,
EVENT_SCAN_ADF_NO_DOCS : ERROR_STATE_OK,
EVENT_SCAN_ADF_MISPICK : ERROR_STATE_WARNING,
EVENT_SCAN_BUSY : ERROR_STATE_SCANNING,
# Fax
EVENT_FAX_DIALING : ERROR_STATE_BUSY,
EVENT_FAX_CONNECTING : ERROR_STATE_BUSY,
......@@ -603,6 +614,7 @@ ALIGN_TYPE_AIO = 13 # AiO Non-LIDIL (OJ J4500/J4600)
ALIGN_TYPE_LIDIL_DJ_D1600 = 14
ALIGN_TYPE_LEDM = 15
ALIGN_TYPE_LEDM_MANUAL = 16
ALIGN_TYPE_LEDM_FF_CC_0 = 17
# clean-types
CLEAN_TYPE_UNSUPPORTED = -1
......@@ -634,6 +646,7 @@ STATUS_TYPE_LJ_XML = 6
STATUS_TYPE_PJL = 8
STATUS_TYPE_PML_AND_PJL = 9 # Same as types 3(tbx)+8(hp:)
STATUS_TYPE_LEDM = 10 # Low-end Data Model
STATUS_TYPE_LEDM_FF_CC_0 = 11 #Low-end Data Model over FF/CC/0 USB channel
# status-battery-check
STATUS_BATTERY_CHECK_NONE = 0
......@@ -688,17 +701,11 @@ SCAN_TYPE_SCL_DUPLEX = 6
SCAN_TYPE_LEDM = 7
SCAN_TYPE_MARVEL2 = 8
# scan-styles
SCAN_STYLE_NONE = 0
SCAN_STYLE_FLATBED = 1
SCAN_STYLE_SCROLLFED = 2
SCAN_STYLE_BOTH = 3
# scan-src
SCAN_SRC_NA = 0
SCAN_SRC_ADF = 1
SCAN_SRC_FLATBED = 2
SCAN_SRC_BOTH = 3
SCAN_SRC_NONE = 0x0
SCAN_SRC_FLATBED = 0x1
SCAN_SRC_SCROLLFED = 0x2
SCAN_SRC_CAMERA = 0x4
# copy-types
COPY_TYPE_NOT_SUPPORTED = -1
......@@ -781,6 +788,12 @@ PLUGIN_NONE = 0
PLUGIN_REQUIRED = 1
PLUGIN_OPTIONAL = 2
#Plugin installation status values
PLUGIN_VERSION_MISMATCH = '-1'
PLUGIN_NOT_INSTALLED = '0'
PLUGIN_INSTALLED = '1'
# plugin-reason
PLUGIN_REASON_NONE = 0x0
PLUGIN_REASON_PRINTING_SUPPORT = 0x1
......@@ -862,3 +875,11 @@ SUPPORT_RELEASED = 1
#USB-Autoplugin-installation
EVENT_AUTO_CONFIGURE = 900
# Queue diagnosis codes
QUEUES_CONFIG_ERROR = 1
QUEUES_PAUSED = 2
QUEUES_INCORRECT_PPD = 3
QUEUES_USER_GROUPS_ERROR = 4
QUEUES_MSG_SENDING = 5
......@@ -96,7 +96,7 @@ usb_pat = re.compile(r"""(\d+):(\d+)""", re.IGNORECASE)
### **********Lambda Function UniStar for checking type of arguments to constructor of class event*******************************
UniStr = lambda title: isinstance(title, str) and utils.xrstrip(title, '\x00')[:128] or utils.xrstrip(title, '\x00')[:128].encode('utf-8')
UniStr = lambda title: isinstance(title, str) and utils.xrstrip(title, '\x00')[:128] or utils.xrstrip(title, '\x00')[:128].encode('utf-8')
#
......@@ -1303,7 +1303,7 @@ class Device(object):
def openEWS_LEDM(self):
return self.__openChannel(hpmudext.HPMUD_S_EWS_LEDM_CHANNEL)
def openLEDM(self):
return self.__openChannel(hpmudext.HPMUD_S_LEDM_SCAN)
......@@ -1330,7 +1330,7 @@ class Device(object):
def closeEWS_LEDM(self):
return self.__closeChannel(hpmudext.HPMUD_S_EWS_LEDM_CHANNEL)