コード例 #1
0
	def __init__(self, is_compressed, phys_size, real_size_packer, underlying):
		"""
		:is_comprseed: contextual to determine if compressed
		:phys_size: contextual of physical size
		:real_size_pkr: packer to unpack "real_size" of compressed data (if compressed)
		
		if not compressed identical to ByteLimitedRange
		"""
		self.is_compressed = _contextify(is_compressed)
		self.phys_size = _contextify(phys_size)
		self.real_size_packer = real_size_packer
		self.underlying = underlying
コード例 #2
0
ファイル: adapters.py プロジェクト: agoose77/construct3
 def __init__(self, expr):
     SymmetricAdapter.__init__(self, noop)
     self.expr = _contextify(expr)
コード例 #3
0
ファイル: adapters.py プロジェクト: agoose77/construct3
 def __init__(self, length, padchar = six.b("\x00"), strict = False):
     self.length = _contextify(length)
     self.padchar = padchar
     self.strict = strict
     Adapter.__init__(self, Raw(self.length))
コード例 #4
0
ファイル: macros.py プロジェクト: Tim---/construct3
def If(cond, thenpkr, elsepkr):
    return Switch(lambda ctx, cond = _contextify(cond): bool(cond(ctx)), 
        {True : thenpkr, False : elsepkr})
コード例 #5
0
ファイル: macros.py プロジェクト: agoose77/construct3
def If(cond, thenpkr, elsepkr):
    return Switch(lambda ctx, cond = _contextify(cond): bool(cond(ctx)), 
        {True : thenpkr, False : elsepkr})
コード例 #6
0
	def __init__(self, size, itempkr, strict=False):
		self.size = _contextify(size)
		self.itempkr = itempkr
		self.strict = strict
コード例 #7
0
	def __init__(self, size):
		self.getsize = _contextify(size)
コード例 #8
0
 def __init__(self, expr):
     SymmetricAdapter.__init__(self, noop)
     self.expr = _contextify(expr)
コード例 #9
0
 def __init__(self, length, padchar=six.b("\x00"), strict=False):
     self.length = _contextify(length)
     self.padchar = padchar
     self.strict = strict
     Adapter.__init__(self, Raw(self.length))