From 118909b4774b47d0b84446e20fd8a6aeed1eabf7 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 26 Apr 2011 16:56:28 +0000 Subject: h-client: started the parsing of the lsusb command --- h-client/hlibrary.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'h-client/hlibrary.py') 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 -- cgit v1.2.3