diff options
author | Sachin Kelkar <sachinkel19@gmail.com> | 2017-02-08 21:16:17 +0530 |
---|---|---|
committer | Sachin Kelkar <sachinkel19@gmail.com> | 2017-02-08 21:16:17 +0530 |
commit | 5dd54ef012c95c6b20899f3d94b2dc65f634636d (patch) | |
tree | 9db6a3475dea0f8c1e1c2ac806084dfe9f42ba57 | |
parent | 28c0596742674dd59df317a91389f3826b7d5e66 (diff) | |
download | mitmproxy-5dd54ef012c95c6b20899f3d94b2dc65f634636d.tar.gz mitmproxy-5dd54ef012c95c6b20899f3d94b2dc65f634636d.tar.bz2 mitmproxy-5dd54ef012c95c6b20899f3d94b2dc65f634636d.zip |
Update kaitaistruct version to 0.6
-rw-r--r-- | mitmproxy/contrib/kaitaistruct/gif.py | 38 | ||||
-rw-r--r-- | mitmproxy/contrib/kaitaistruct/png.py | 20 | ||||
-rw-r--r-- | setup.py | 2 |
3 files changed, 30 insertions, 30 deletions
diff --git a/mitmproxy/contrib/kaitaistruct/gif.py b/mitmproxy/contrib/kaitaistruct/gif.py index 3a847d54..61499cc7 100644 --- a/mitmproxy/contrib/kaitaistruct/gif.py +++ b/mitmproxy/contrib/kaitaistruct/gif.py @@ -69,18 +69,18 @@ class Gif(KaitaiStruct): @property def has_color_table(self): if hasattr(self, '_m_has_color_table'): - return self._m_has_color_table + return self._m_has_color_table if hasattr(self, '_m_has_color_table') else None self._m_has_color_table = (self.flags & 128) != 0 - return self._m_has_color_table + return self._m_has_color_table if hasattr(self, '_m_has_color_table') else None @property def color_table_size(self): if hasattr(self, '_m_color_table_size'): - return self._m_color_table_size + return self._m_color_table_size if hasattr(self, '_m_color_table_size') else None self._m_color_table_size = (2 << (self.flags & 7)) - return self._m_color_table_size + return self._m_color_table_size if hasattr(self, '_m_color_table_size') else None class LocalImageDescriptor(KaitaiStruct): @@ -103,34 +103,34 @@ class Gif(KaitaiStruct): @property def has_color_table(self): if hasattr(self, '_m_has_color_table'): - return self._m_has_color_table + return self._m_has_color_table if hasattr(self, '_m_has_color_table') else None self._m_has_color_table = (self.flags & 128) != 0 - return self._m_has_color_table + return self._m_has_color_table if hasattr(self, '_m_has_color_table') else None @property def has_interlace(self): if hasattr(self, '_m_has_interlace'): - return self._m_has_interlace + return self._m_has_interlace if hasattr(self, '_m_has_interlace') else None self._m_has_interlace = (self.flags & 64) != 0 - return self._m_has_interlace + return self._m_has_interlace if hasattr(self, '_m_has_interlace') else None @property def has_sorted_color_table(self): if hasattr(self, '_m_has_sorted_color_table'): - return self._m_has_sorted_color_table + return self._m_has_sorted_color_table if hasattr(self, '_m_has_sorted_color_table') else None self._m_has_sorted_color_table = (self.flags & 32) != 0 - return self._m_has_sorted_color_table + return self._m_has_sorted_color_table if hasattr(self, '_m_has_sorted_color_table') else None @property def color_table_size(self): if hasattr(self, '_m_color_table_size'): - return self._m_color_table_size + return self._m_color_table_size if hasattr(self, '_m_color_table_size') else None self._m_color_table_size = (2 << (self.flags & 7)) - return self._m_color_table_size + return self._m_color_table_size if hasattr(self, '_m_color_table_size') else None class Block(KaitaiStruct): @@ -162,7 +162,7 @@ class Gif(KaitaiStruct): self._io = _io self._parent = _parent self._root = _root if _root else self - self.magic = self._io.ensure_fixed_contents(3, struct.pack('3b', 71, 73, 70)) + self.magic = self._io.ensure_fixed_contents(struct.pack('3b', 71, 73, 70)) self.version = self._io.read_bytes(3) @@ -171,27 +171,27 @@ class Gif(KaitaiStruct): self._io = _io self._parent = _parent self._root = _root if _root else self - self.block_size = self._io.ensure_fixed_contents(1, struct.pack('1b', 4)) + self.block_size = self._io.ensure_fixed_contents(struct.pack('1b', 4)) self.flags = self._io.read_u1() self.delay_time = self._io.read_u2le() self.transparent_idx = self._io.read_u1() - self.terminator = self._io.ensure_fixed_contents(1, struct.pack('1b', 0)) + self.terminator = self._io.ensure_fixed_contents(struct.pack('1b', 0)) @property def transparent_color_flag(self): if hasattr(self, '_m_transparent_color_flag'): - return self._m_transparent_color_flag + return self._m_transparent_color_flag if hasattr(self, '_m_transparent_color_flag') else None self._m_transparent_color_flag = (self.flags & 1) != 0 - return self._m_transparent_color_flag + return self._m_transparent_color_flag if hasattr(self, '_m_transparent_color_flag') else None @property def user_input_flag(self): if hasattr(self, '_m_user_input_flag'): - return self._m_user_input_flag + return self._m_user_input_flag if hasattr(self, '_m_user_input_flag') else None self._m_user_input_flag = (self.flags & 2) != 0 - return self._m_user_input_flag + return self._m_user_input_flag if hasattr(self, '_m_user_input_flag') else None class Subblock(KaitaiStruct): diff --git a/mitmproxy/contrib/kaitaistruct/png.py b/mitmproxy/contrib/kaitaistruct/png.py index 5b0e3ca3..2f3c1a5c 100644 --- a/mitmproxy/contrib/kaitaistruct/png.py +++ b/mitmproxy/contrib/kaitaistruct/png.py @@ -25,9 +25,9 @@ class Png(KaitaiStruct): self._io = _io self._parent = _parent self._root = _root if _root else self - self.magic = self._io.ensure_fixed_contents(8, struct.pack('8b', -119, 80, 78, 71, 13, 10, 26, 10)) - self.ihdr_len = self._io.ensure_fixed_contents(4, struct.pack('4b', 0, 0, 0, 13)) - self.ihdr_type = self._io.ensure_fixed_contents(4, struct.pack('4b', 73, 72, 68, 82)) + self.magic = self._io.ensure_fixed_contents(struct.pack('8b', -119, 80, 78, 71, 13, 10, 26, 10)) + self.ihdr_len = self._io.ensure_fixed_contents(struct.pack('4b', 0, 0, 0, 13)) + self.ihdr_type = self._io.ensure_fixed_contents(struct.pack('4b', 73, 72, 68, 82)) self.ihdr = self._root.IhdrChunk(self._io, self, self._root) self.ihdr_crc = self._io.read_bytes(4) self.chunks = [] @@ -117,18 +117,18 @@ class Png(KaitaiStruct): @property def x(self): if hasattr(self, '_m_x'): - return self._m_x + return self._m_x if hasattr(self, '_m_x') else None self._m_x = (self.x_int / 100000.0) - return self._m_x + return self._m_x if hasattr(self, '_m_x') else None @property def y(self): if hasattr(self, '_m_y'): - return self._m_y + return self._m_y if hasattr(self, '_m_y') else None self._m_y = (self.y_int / 100000.0) - return self._m_y + return self._m_y if hasattr(self, '_m_y') else None class BkgdGreyscale(KaitaiStruct): @@ -186,7 +186,7 @@ class Png(KaitaiStruct): self._io = _io self._parent = _parent self._root = _root if _root else self - self.render_intent = self._root.Intent(self._io.read_u1()) + self.render_intent = self._root.SrgbChunk.Intent(self._io.read_u1()) class CompressedTextChunk(KaitaiStruct): @@ -220,10 +220,10 @@ class Png(KaitaiStruct): @property def gamma_ratio(self): if hasattr(self, '_m_gamma_ratio'): - return self._m_gamma_ratio + return self._m_gamma_ratio if hasattr(self, '_m_gamma_ratio') else None self._m_gamma_ratio = (100000.0 / self.gamma_int) - return self._m_gamma_ratio + return self._m_gamma_ratio if hasattr(self, '_m_gamma_ratio') else None class BkgdChunk(KaitaiStruct): @@ -71,7 +71,7 @@ setup( "html2text>=2016.1.8, <=2016.9.19", "hyperframe>=4.0.1, <5", "jsbeautifier>=1.6.3, <1.7", - "kaitaistruct>=0.5, <0.6", + "kaitaistruct>=0.6, <0.7", "Pillow>=3.2, <4.1", "passlib>=1.6.5, <1.8", "pyasn1>=0.1.9, <0.2", |