weather/stations/davis.py
def _use_rev_b_archive(self, records, offset):
        '''
        return True if weather station returns Rev.B archives
        '''
        # if pre-determined, return result
        if type(self._ARCHIVE_REV_B) is bool:
            return self._ARCHIVE_REV_B
        # assume, B and check 'RecType' field
        data = ArchiveBStruct.unpack_from(records, offset)
        if data['RecType'] == 0:
            log.info('detected archive rev. B')
            self._ARCHIVE_REV_B = True
        else:
            log.info('detected archive rev. A')
            self._ARCHIVE_REV_B = False

        return self._ARCHIVE_REV_B
def _use_rev_b_archive(self, records, offset):
        '''
        return True if weather station returns Rev.B archives
        '''
        # if pre-determined, return result
        if type(self._ARCHIVE_REV_B) is bool:
            return self._ARCHIVE_REV_B
        # assume, B and check 'RecType' field
        data = ArchiveBStruct.unpack_from(records, offset)
        if data['RecType'] == 0:
            log.info('detected archive rev. B')
            self._ARCHIVE_REV_B = True
        else:
            log.info('detected archive rev. A')
            self._ARCHIVE_REV_B = False

        return self._ARCHIVE_REV_B
def _use_rev_b_archive ( self , records , offset ) : # if pre-determined, return result if type ( self . _ARCHIVE_REV_B ) is bool : return self . _ARCHIVE_REV_B # assume, B and check 'RecType' field data = ArchiveBStruct . unpack_from ( records , offset ) if data [ 'RecType' ] == 0 : log . info ( 'detected archive rev. B' ) self . _ARCHIVE_REV_B = True else : log . info ( 'detected archive rev. A' ) self . _ARCHIVE_REV_B = False return self . _ARCHIVE_REV_B
return True if weather station returns Rev.B archives
return True if weather station returns Rev . B archives