Commit d41a31a0 authored by Didier Raboud's avatar Didier Raboud

Imported Upstream version 3.9.4b

parent 3bd33ae1

Too many changes to show.

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

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -461,6 +461,14 @@ SYSTRAY_VISIBLE_SHOW_ALWAYS = 0
SYSTRAY_VISIBLE_HIDE_WHEN_INACTIVE = 1
SYSTRAY_VISIBLE_HIDE_ALWAYS = 2
#
# Systray messages setting
#
SYSTRAY_MESSAGES_SHOW_ALL = 0
SYSTRAY_MESSAGES_SHOW_ERRORS_AND_WARNINGS = 1
SYSTRAY_MESSAGES_SHOW_ERRORS_ONLY = 2
SYSTRAY_MESSAGES_SHOW_NONE = 3
#
# Defines for model query types and status query
#
......@@ -698,7 +706,7 @@ MODEL_TYPE2_BIJ = 8
MODEL_TYPE2_EDGELINE = 9
MODEL_TYPE2_APOLLO = 10
MODEL_TYPE2_SCANJET = 11 # not supported
MODEL_TYPE2_DESIGNJET = 12 # not supported
MODEL_TYPE2_DESIGNJET = 12
MODEL_TYPE2_OTHER = 13 # No specific "sub-brand" (e.g., 910, cp1610)
MONITOR_TYPE_UNSUPPORTED = -1
......
......@@ -193,7 +193,7 @@ sys_conf = SysConfig()
# System State File: System-wide runtime settings
sys_state = State()
# Per-user Settings File:
# Per-user Settings File: (Note: For Qt4 code, limit the use of this to non-GUI apps. only)
user_conf = UserConfig()
......@@ -205,7 +205,7 @@ except ValueError:
prop.encoding = 'UTF8'
prop.version = sys_conf.get('hplip', 'version', '0.0.0') # e.g., 3.9.2b.10
_p, _x = re.compile(r'(\d*)', re.I), []
_p, _x = re.compile(r'(\d\w*)', re.I), []
for _y in prop.version.split('.')[:3]:
_z = _p.match(_y)
if _z is not None:
......
......@@ -280,7 +280,9 @@ class ModelData:
'usb-pid' : TYPE_HEX,
'usb-vid' : TYPE_HEX,
'job-storage' : TYPE_INT,
}
self.FIELD_TYPES_DYN = {
# Dynamic model data (from device query)
'dev-file' : TYPE_STR,
'fax-uri' : TYPE_STR,
......@@ -332,7 +334,7 @@ class ModelData:
re.compile('^agent(\d+)-sku', re.IGNORECASE) : TYPE_STR,
re.compile('^in-tray(\d+)', re.IGNORECASE) : TYPE_BOOL,
re.compile('^out-tray(\d+)', re.IGNORECASE) : TYPE_BOOL,
re.compile('model(\d+)', re.IGNORECASE) : TYPE_STR,
re.compile('^model(\d+)', re.IGNORECASE) : TYPE_STR,
}
self.TYPE_CACHE = {}
......@@ -476,16 +478,19 @@ class ModelData:
return self.FIELD_TYPES[key]
except KeyError:
try:
return self.TYPE_CACHE[key]
return self.FIELD_TYPES_DYN[key]
except KeyError:
for pat, typ in self.RE_FIELD_TYPES.items():
match = pat.match(key)
if match is not None:
self.TYPE_CACHE[key] = typ
return typ
log.warn("get_data_type(): Defaulted to TYPE_STR for key %s" % key)
return TYPE_STR
try:
return self.TYPE_CACHE[key]
except KeyError:
for pat, typ in self.RE_FIELD_TYPES.items():
match = pat.match(key)
if match is not None:
self.TYPE_CACHE[key] = typ
return typ
log.error("get_data_type(): Field type lookup failed for key %s" % key)
return None
def convert_data(self, key, value, typ=None):
......
......@@ -171,13 +171,14 @@ class Module(object):
content.append(utils.USAGE_DEVICE)
content.append(utils.USAGE_PRINTER)
if self.avail_modes is not None and self.num_valid_modes > 1 and self.num_installed_ui_toolkits > 1:
if self.avail_modes is not None and self.num_valid_modes > 1:
summary.append('[MODE]')
content.append(utils.USAGE_SPACE)
content.append(utils.USAGE_MODE)
if GUI_MODE in self.avail_modes and prop.gui_build:
content.append(utils.USAGE_GUI_MODE)
if self.num_installed_ui_toolkits > 0:
if GUI_MODE in self.avail_modes and prop.gui_build:
content.append(utils.USAGE_GUI_MODE)
if INTERACTIVE_MODE in self.avail_modes:
content.append(utils.USAGE_INTERACTIVE_MODE)
......@@ -191,8 +192,8 @@ class Module(object):
content.append(utils.USAGE_OPTIONS)
if self.avail_modes is not None and GUI_MODE in self.avail_modes and \
self.supported_ui_toolkits is not None and self.num_supported_ui_toolkits > 1 and \
prop.gui_build and self.num_installed_ui_toolkits > 1:
self.supported_ui_toolkits is not None and self.num_supported_ui_toolkits > 0 and \
prop.gui_build and self.num_installed_ui_toolkits > 0:
if UI_TOOLKIT_QT3 in self.supported_ui_toolkits and UI_TOOLKIT_QT3 in self.installed_ui_toolkits:
content.append(utils.USAGE_USE_QT3)
......
This diff is collapsed.
......@@ -130,7 +130,7 @@ def buildPMLSetPacket(oid, value, data_type): # String dotted notation
return p
def ConvertToPMLDataFormat(value, data_type):
def ConvertToPMLDataFormat(value, data_type):
if data_type in (TYPE_ENUMERATION, TYPE_SIGNED_INTEGER, TYPE_COLLECTION):
data = struct.pack(">i", int(value))
......@@ -528,7 +528,7 @@ OID_POWER_SETTINGS_NEVER = 999
#
OID_DEV_DOWNLOAD_TIMEOUT = ('1.1.1.17', TYPE_SIGNED_INTEGER)
DEFAULT_DOWNLOAD_TIMEOUT = 60
DEFAULT_DOWNLOAD_TIMEOUT = 600
OID_FAX_DOWNLOAD_ERROR = ('1.3.7.2.6', TYPE_SIGNED_INTEGER)
......@@ -765,7 +765,7 @@ COPIER_MEDIA_TYPE_PHOTO_GLOSSY = 10
COPIER_MEDIA_TYPE_MATTE_PAPER = 11
COPIER_MEDIA_TYPE_EVERYDAY_PHOTO = 12
COPIER_MEDIA_TYPE_PHOTO_QUAL_INKJET = 13
COPIER_MEDIA_TYPE_PHOTO = 14
COPIER_MEDIA_TYPE_PHOTO = 14
COPIER_MEDIA_TYPE_AUTOMATIC = 15
COPIER_MEDIA_TYPE_ADVANCED_PHOTO = 16
COPIER_MEDIA_TYPE_IRON_ON_MIRRORED = 17
......
......@@ -23,7 +23,7 @@ from __future__ import division
# Std Lib
import struct
import cStringIO
import cStringIO
import xml.parsers.expat as expat
import re
......@@ -288,7 +288,7 @@ def parseVStatus(s):
try:
fields[2]
except IndexError:
except IndexError:
top_lid = 1 # something went wrong!
else:
if fields[2] == 'DN':
......@@ -312,7 +312,7 @@ def parseVStatus(s):
'in-tray2' : IN_TRAY_NOT_PRESENT,
'media-path' : MEDIA_PATH_CUT_SHEET, # ?
}
def parseStatus(DeviceID):
if 'VSTATUS' in DeviceID:
......@@ -653,9 +653,9 @@ setup_panel_translator()
def PanelCheck(dev):
line1, line2 = '', ''
if dev.io_mode not in (IO_MODE_RAW, IO_MODE_UNI):
try:
dev.openPML()
except Error:
......@@ -725,7 +725,7 @@ def BatteryCheck(dev, status_block, battery_check):
else:
if battery_check == STATUS_BATTERY_CHECK_PML:
result, battery_level = dev.getPML(pml.OID_BATTERY_LEVEL_2)
if result > pml.ERROR_MAX_OK:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
......@@ -735,7 +735,7 @@ def BatteryCheck(dev, status_block, battery_check):
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
return
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
......@@ -745,7 +745,7 @@ def BatteryCheck(dev, status_block, battery_check):
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
return
else: # STATUS_BATTERY_CHECK_STD
result, battery_level = dev.getPML(pml.OID_BATTERY_LEVEL)
result, power_mode = dev.getPML(pml.OID_POWER_MODE)
......@@ -778,7 +778,7 @@ def BatteryCheck(dev, status_block, battery_check):
'level-trigger' : battery_trigger_level,
})
return
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
......@@ -795,7 +795,7 @@ def BatteryCheck(dev, status_block, battery_check):
finally:
dev.closePML()
if battery_check == STATUS_BATTERY_CHECK_STD and \
try_dynamic_counters:
......@@ -822,7 +822,7 @@ def BatteryCheck(dev, status_block, battery_check):
})
finally:
dev.closePrint()
else:
status_block['agents'].append({
'kind' : AGENT_KIND_INT_BATTERY,
......@@ -831,7 +831,7 @@ def BatteryCheck(dev, status_block, battery_check):
'level' : 0,
'level-trigger' : AGENT_LEVEL_TRIGGER_SUFFICIENT_0,
})
# this works for 2 pen products that allow 1 or 2 pens inserted
......@@ -875,7 +875,7 @@ def getPenConfiguration(s): # s=status dict from parsed device ID
def getFaxStatus(dev):
tx_active, rx_active = False, False
if dev.io_mode not in (IO_MODE_UNI, IO_MODE_RAW):
try:
dev.openPML()
......@@ -896,8 +896,8 @@ def getFaxStatus(dev):
dev.closePML()
return tx_active, rx_active