pytools/gpioutil: Strip whitespace from value read
Reading from the value file includes a newline following the value, so
strip it.
Signed-off-by: Xo Wang <xow@google.com>
Change-Id: I075794d80f6db0ad8169c6a142ea56b34bd87164
diff --git a/pytools/gpioutil b/pytools/gpioutil
index 5ed13e2..6589060 100644
--- a/pytools/gpioutil
+++ b/pytools/gpioutil
@@ -73,7 +73,7 @@
raise Exception("ERROR - Invalid value: "+value)
def getValue(self):
- return self.read(self.getPath('value'))
+ return self.read(self.getPath('value'))
def write(self,path,data):
f = open(path,'w')
@@ -83,7 +83,7 @@
def read(self,path):
f = open(path,'r')
- data = f.readline()
+ data = f.readline().strip()
f.close()
return data