From 10a7a549410924c77e2fa23a1a557e19418a3504 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 6 May 2011 14:39:59 +0000 Subject: h-client:added new class-subclass-protocol for USB devices --- h-client/hlibrary.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'h-client') diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py index 7f9d900..0b3613c 100644 --- a/h-client/hlibrary.py +++ b/h-client/hlibrary.py @@ -502,6 +502,22 @@ class Client: 'type' : 'printer', 'controller': 'printers' }, + 'e00101' : { + 'type' : 'bluetooth', + 'controller': 'bluetooth' + }, + '020205' : { + 'type' : '3G-card', + 'controller': 'threegcards' + }, + '0e0100' : { + 'type' : 'webcam', + 'controller': 'webcams' + }, + 'ff0100' : { + 'type' : 'webcam', + 'controller': 'webcams' + }, '255255255' : { 'type' : 'unknown', 'controller': 'unknown' @@ -718,7 +734,7 @@ class Client: self.errors.append('tmp folder not writable') - #parse the output of the lspci command + #parse the output of the lsusb command if not os.system('lsusb -v > tmp/temp'): f = open('tmp/temp','r') @@ -833,9 +849,6 @@ class Client: code = device.getElementsByTagName("vendorid_productid")[0] if code.hasChildNodes(): if (code.childNodes[0].data == vendorid_productid): - - - modelName = device.getElementsByTagName("model_name")[0].childNodes[0].data.encode('utf-8') interface = device.getElementsByTagName("interface")[0].childNodes[0].data.encode('utf-8') distribution = device.getElementsByTagName("distribution")[0].childNodes[0].data.encode('utf-8') @@ -844,9 +857,10 @@ class Client: if deviceType == 'printer' or deviceType == 'scanner': works = device.getElementsByTagName("compatibility")[0].childNodes[0].data.encode('utf-8') - #set the subtype - subtype = device.getElementsByTagName("subtype")[0].childNodes[0].data.encode('utf-8') - dev[0].setSubtype(subtype) + if deviceType == 'printer': + #set the subtype + subtype = device.getElementsByTagName("subtype")[0].childNodes[0].data.encode('utf-8') + dev[0].setSubtype(subtype) else: works = device.getElementsByTagName("it_works")[0].childNodes[0].data.encode('utf-8') -- cgit v1.2.3