Пример #1
0
 def diagnose_binaryblock(klass, binaryblock, endianness=None):
     ''' Run checks over header binary data, return string '''
     hdr = klass(binaryblock, endianness=endianness, check=False)
     battrun = BatteryRunner(klass._get_checks())
     reports = battrun.check_only(hdr)
     return '\n'.join([report.message
                       for report in reports if report.message])
Пример #2
0
 def check_fix(self,
           logger=imageglobals.logger,
           error_level=imageglobals.error_level):
     ''' Check header data with checks '''
     battrun = BatteryRunner(self.__class__._get_checks())
     self, reports = battrun.check_fix(self)
     for report in reports:
         report.log_raise(logger, error_level)