aboutsummaryrefslogtreecommitdiff
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
parent529eabaa67861491153b2b302444dd40f1d89d54 (diff)
h-client: started the parsing of the lsusb command
-rw-r--r--h-client/credits.txt3
-rw-r--r--h-client/hlibrary.py21
-rw-r--r--h-client/test.py2
3 files changed, 20 insertions, 6 deletions
diff --git a/h-client/credits.txt b/h-client/credits.txt
index 792f571..e772eff 100644
--- a/h-client/credits.txt
+++ b/h-client/credits.txt
@@ -23,5 +23,6 @@ odict.py
Copyright (C) 2005 Nicola Larosa, Michael Foord
python library to manage ordered dictionaries
licensed under the terms of the BSD license
-
+E-mail: nico AT tekNico DOT net, fuzzyman AT voidspace DOT org DOT uk
+Documentation at http://www.voidspace.org.uk/python/odict.html
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
diff --git a/h-client/test.py b/h-client/test.py
index 07ccca0..9fef89c 100644
--- a/h-client/test.py
+++ b/h-client/test.py
@@ -23,7 +23,7 @@ client.setNode('http://h-source/')
client.createDevices()
#client.request.perform('download/all/it')
#print client.request.url
-client.sync()
+#client.sync()
#for key,dev in client.devices.iteritems():
#print key