aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-26 16:56:28 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-26 16:56:28 +0000
commit118909b4774b47d0b84446e20fd8a6aeed1eabf7 (patch)
treeb8a4f78a6ba8c7b53cc483ccf38d40051696d7e5 /h-client/hlibrary.py
parent529eabaa67861491153b2b302444dd40f1d89d54 (diff)
h-client: started the parsing of the lsusb command
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 38e7f78..f0e84d6 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -510,6 +510,7 @@ class Client:
def createDevices(self):
+ #parse the poutput of the lspci command
if not os.system('lspci -vmmnn > tmp/temp'):
f = open('tmp/temp','r')
@@ -551,18 +552,30 @@ class Client:
self.devices['p_' + dev.getVendorId() + ':' + dev.getProductId()] = [dev,cl.group(2),'insert','0']
else:
- self._status = False
self.errors.append('the lspci -vmmnn output is not a standard output, some products row not found')
else:
- self._status = False
self.errors.append('the lspci -vmmnn output is not a standard output, some vendors row not found')
else:
- self._status = False
self.errors.append('the lspci -vmmnn output is not a standard output, some class row not found')
f.close();
else:
- self._status = False
+ self.errors.append('tmp folder not writable')
+
+ #parse the poutput of the lspci command
+ if not os.system('lsusb -v > tmp/temp'):
+ f = open('tmp/temp','r')
+
+ while 1:
+ row = f.readline()
+
+ print row
+
+ if not row:
+ break
+
+ f.close();
+ else:
self.errors.append('tmp folder not writable')
#syncronize with the xml database