예제 #1
0
 def __init__(self,
              parent,
              name,
              nbits,
              description="Padding",
              pattern=None):
     Bits.__init__(self, parent, name, nbits, description)
     self.pattern = pattern
     self._display_pattern = self.checkPattern()
예제 #2
0
파일: midi.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 8, description)
     stream = parent.stream
     addr = self.absolute_address
     value = 0
     while True:
         bits = stream.readBits(addr, 8, parent.endian)
         value = (value << 7) + (bits & 127)
         if not (bits & 128):
             break
         addr += 8
         self._size += 8
         if 32 < self._size:
             raise ParserError("Integer size is bigger than 32-bit")
     self.createValue = lambda: value
예제 #3
0
파일: midi.py 프로젝트: esc777690/LGK-Hub
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 8, description)
     stream = parent.stream
     addr = self.absolute_address
     value = 0
     while True:
         bits = stream.readBits(addr, 8, parent.endian)
         value = (value << 7) + (bits & 127)
         if not (bits & 128):
             break
         addr += 8
         self._size += 8
         if 32 < self._size:
             raise ParserError("Integer size is bigger than 32-bit")
     self.createValue = lambda: value
예제 #4
0
    def __init__(self, parent, name, description=None):
        Bits.__init__(self, parent, name, 8, description)

        stream = self._parent.stream

        addr = self.absolute_address
        size = 8
        byte = stream.readBits(addr, 8, BIG_ENDIAN)

        value = byte & 0x7F
        while byte & 0x80:
            addr += 8
            size += 8
            byte = stream.readBits(addr, 8, BIG_ENDIAN)
            value = (value << 7) + (byte & 0x7F)
        self._size = size
        self.createValue = lambda: value
예제 #5
0
 def __init__(self, parent, name, signed=False, nbits=30, description=None):
     Bits.__init__(self, parent, name, 8, description)
     stream = self._parent.stream
     addr = self.absolute_address
     size = 0
     value = 0
     mult = 1
     while True:
         byte = stream.readBits(addr + size, 8, LITTLE_ENDIAN)
         value += mult * (byte & 0x7f)
         size += 8
         mult <<= 7
         if byte < 128:
             break
     self._size = size
     if signed and (1 << (nbits - 1)) <= value:
         value -= (1 << nbits)
     self.createValue = lambda: value
예제 #6
0
파일: asn1.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 8, description)
     stream = self._parent.stream
     addr = self.absolute_address
     size = 8
     value = 0
     byte = stream.readBits(addr, 8, BIG_ENDIAN)
     value = byte & 127
     while 128 <= byte:
         addr += 8
         size += 8
         if 64 < size:
             # Arbitrary limit to catch errors
             raise ParserError("ASN.1: Object identifier is limited 64 bits")
         byte = stream.readBits(addr, 8, BIG_ENDIAN)
         value = (value << 7) + (byte & 127)
     self._size = size
     self.createValue = lambda: value
예제 #7
0
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 8, description)
     stream = self._parent.stream
     addr = self.absolute_address
     size = 8
     value = 0
     byte = stream.readBits(addr, 8, BIG_ENDIAN)
     value = byte & 127
     while 128 <= byte:
         addr += 8
         size += 8
         if 64 < size:
             # Arbitrary limit to catch errors
             raise ParserError(
                 "ASN.1: Object identifier is limited 64 bits")
         byte = stream.readBits(addr, 8, BIG_ENDIAN)
         value = (value << 7) + (byte & 127)
     self._size = size
     self.createValue = lambda: value
예제 #8
0
 def __init__(self, parent, name, description=None):
     Bits.__init__(self,
                   parent,
                   name,
                   self.static_size,
                   description=description)
예제 #9
0
 def __init__(self, parent, name):
     Bits.__init__(self, parent, name, 4)
예제 #10
0
파일: lnk.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name, size, description=None):
     Bits.__init__(self, parent, name, size, None)
     self.desc = description
예제 #11
0
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, self.static_size, description=description)
예제 #12
0
 def __init__(self, parent, name, size):
     Bits.__init__(self, parent, name, size)
     self.bias = 2**(size - 1) - 1
예제 #13
0
 def __init__(self, parent, name, signed, size, description=None):
     if not (8 <= size <= 16384):
         raise FieldError("Invalid integer size (%s): have to be in 8..16384" % size)
     Bits.__init__(self, parent, name, size, description)
     self.signed = signed
예제 #14
0
파일: id3.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 32, description)
예제 #15
0
 def __init__(self, parent, name, nbits, description="Padding", pattern=None):
     Bits.__init__(self, parent, name, nbits, description)
     self.pattern = pattern
     self._display_pattern = self.checkPattern()
예제 #16
0
 def __init__(self, parent, name, description=None):
     Bits.__init__(self, parent, name, 32, description)
예제 #17
0
파일: float.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name, size):
     Bits.__init__(self, parent, name, size)
     self.bias = 2 ** (size - 1) - 1
예제 #18
0
파일: lnk.py 프로젝트: esc777690/LGK-Hub
 def __init__(self, parent, name, size, description=None):
     Bits.__init__(self, parent, name, size, None)
     self.desc = description
예제 #19
0
 def __init__(self, parent, name, signed, size, description=None):
     if not (8 <= size <= 16384):
         raise FieldError(
             "Invalid integer size (%s): have to be in 8..16384" % size)
     Bits.__init__(self, parent, name, size, description)
     self.signed = signed
예제 #20
0
파일: bmp.py 프로젝트: JackDandy/SickGear
 def __init__(self, parent, name):
     Bits.__init__(self, parent, name, 4)