def x_pcnt(self):
        data = self.rawdata
        bytes = self.length
        counter = 0
        if bytes == 4:
            counter = struct.unpack('!I',data)[0]
        else:
            for i in range(0,bytes):
                counter += struct.unpack('B',data[i]) * pow(256,i)
                
        debug('Read Field: %s Len: %d Count: %d' % (self.fid, bytes, counter))
        self.counter = counter
Builds an os_case validator from a specification.
dataset/ETHPy150Open Ciantic/pytagger/tagger/id3v2frame.py/ID3v2BaseFrame.x_pcnt--crossover with--dataset/ETHPy150Open openstack/sahara/sahara/plugins/images.py/SaharaOSCaseValidator.from_spec