Permalink
Browse files

[testudo] strip spaces from serial number

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
hxw committed Apr 2, 2010
1 parent f71f384 commit 748346c75fb67a574ff7039c053257c52f1035e3
Showing with 10 additions and 8 deletions.
  1. +5 −4 testudo/src/ui.py
  2. +5 −4 testudo/src/ui2.py
View
@@ -103,9 +103,10 @@ def runTest(self, count):
auto = self.autoSave.get_active() and 1 == count
self.autoSave.set_active(auto)
+ serial_number = self.serialNumber.get_text().strip()
try:
- if '' == self.serialNumber.get_text():
+ if '' == serial_number:
raise StopTestException('Serial number invalid')
if auto:
@@ -119,10 +120,10 @@ def runTest(self, count):
for cycle in range(1, count + 1):
self.write('\n*** Start of Test %d of %d for PCBA SN: %s ***\n\n' %
- (cycle, count, self.serialNumber.get_text()))
+ (cycle, count, serial_number))
t = time.time()
- sequencer.runOneTest(self, self.fileName, 0, serial_number = self.serialNumber.get_text())
+ sequencer.runOneTest(self, self.fileName, 0, serial_number = serial_number)
t = time.time() - t
self.write('\n*** End of Test %d of %d [%7.3f seconds] ***\n' % (cycle, count, t))
@@ -237,7 +238,7 @@ def save_file(self, autoSave = False):
tag = '.FAIL'
else:
tag = '.OK'
- sn = self.serialNumber.get_text()
+ sn = self.serialNumber.get_text().strip()
if '' == sn:
sn = 'NO-SERIAL-NUMBER'
View
@@ -190,10 +190,11 @@ def runTest(self):
psu = None
s = SerialPort()
- if '' == self.serialNumber.get_text():
+ serialNumber = self.serialNumber.get_text().strip()
+ versionNumber = self.versionNumber.get_text().strip()
+
+ if '' == serialNumber:
raise StopTestException('Serial number invalid')
- serialNumber = self.serialNumber.get_text()
- versionNumber = self.versionNumber.get_text()
program = ProgramPin()
@@ -370,7 +371,7 @@ def save_file(self, autoSave = False):
tag = '.FAIL'
else:
tag = '.OK'
- sn = self.serialNumber.get_text()
+ sn = self.serialNumber.get_text().strip()
if '' == sn:
sn = 'NO-SERIAL-NUMBER'

0 comments on commit 748346c

Please sign in to comment.