diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-06 14:39:59 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-06 14:39:59 +0000 |
commit | 10a7a549410924c77e2fa23a1a557e19418a3504 (patch) | |
tree | fe594ec300257980b178f7c79f8814670d900630 | |
parent | 7dbd7dc987eb70a663c9e26f8f6a5de3671c08a1 (diff) |
h-client:added new class-subclass-protocol for USB devices
-rw-r--r-- | h-client/hlibrary.py | 28 |
1 files changed, 21 insertions, 7 deletions
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') |