32""" Reader that parses a Symbian build log and extracts abld -what sections.
+ 33
+ 34 This reader will return, using the iterator protocol, tuples containing:
+ 35 * Unit name.
+ 36 * List of binaries for that unit.
+ 37
+ 38 """
+
82""" Implement the iterator protocol. """
+ 83loghandle=open(self._logpath,'r')
+ 84
+ 85# Find the ROM image type
+ 86type_match=self.image_type_regex.search(self._logpath)
+ 87image_type=type_match.group(1)
+ 88ifimage_type=='rom'orimage_type.startswith('rofs'):
+ 89# Extract the binary and size info
+ 90forlineinloghandle:
+ 91ifimage_type=='rom':
+ 92match=self.rom_binary_size_regex.match(line)
+ 93ifmatch!=None:
+ 94# Number is in decimal
+ 95size=int(match.group(2))
+ 96yield(match.group(1),size,image_type)
+ 97elifimage_type.startswith('rofs'):
+ 98match=self.rofs_binary_size_regex.search(line)
+ 99ifmatch!=None:
+100# Number is in hexidecimal
+101size=int(match.group(2),16)
+102yield(match.group(1),size,image_type)
+103else:
+104_logger.error('ROM type not matched')
+