Commit 294e661c4a3396202356c2d9873d01ee3f22a797
1 parent
ae568171
renamed ExternalObjectStorage.compressed --> is_compressed
Showing
1 changed file
with
9 additions
and
10 deletions
oletools/ppt_parser.py
| ... | ... | @@ -957,31 +957,30 @@ class ExternalObjectStorage(PptType): |
| 957 | 957 | RECORD_INSTANCE_COMPRESSED = 1 |
| 958 | 958 | RECORD_INSTANCE_UNCOMPRESSED = 0 |
| 959 | 959 | |
| 960 | - def __init__(self, compressed=None): | |
| 960 | + def __init__(self, is_compressed=None): | |
| 961 | 961 | super(ExternalObjectStorage, self).__init__() |
| 962 | - if compressed is None: | |
| 962 | + if is_compressed is None: | |
| 963 | 963 | self.RECORD_INSTANCE = None # otherwise defaults to 0 |
| 964 | - elif compressed: | |
| 964 | + elif is_compressed: | |
| 965 | 965 | self.RECORD_INSTANCE = self.RECORD_INSTANCE_COMPRESSED |
| 966 | - self.compressed = True | |
| 966 | + self.is_compressed = True | |
| 967 | 967 | else: |
| 968 | 968 | self.RECORD_INSTANCE = self.RECORD_INSTANCE_UNCOMPRESSED |
| 969 | - self.compressed = False | |
| 969 | + self.is_compressed = False | |
| 970 | 970 | self.uncompressed_size = None |
| 971 | 971 | self.data_offset = None |
| 972 | 972 | self.data_size = None |
| 973 | 973 | |
| 974 | 974 | def extract_from(self, stream): |
| 975 | - """ not a classmethod because of compressed attrib | |
| 975 | + """ not a classmethod because of is_compressed attrib | |
| 976 | 976 | |
| 977 | 977 | see also: DummyType |
| 978 | 978 | """ |
| 979 | 979 | log.debug('Parsing ExternalObjectStorage (compressed={}) from stream' |
| 980 | - .format(self.compressed)) | |
| 980 | + .format(self.is_compressed)) | |
| 981 | 981 | self.read_rec_head(stream) |
| 982 | 982 | self.data_size = self.rec_head.rec_len |
| 983 | - if self.compressed: | |
| 984 | - log.debug('is compressed --> reduce size') | |
| 983 | + if self.is_compressed: | |
| 985 | 984 | self.uncompressed_size = read_4(stream) |
| 986 | 985 | self.data_size -= 4 |
| 987 | 986 | self.data_offset = stream.tell() |
| ... | ... | @@ -1429,7 +1428,7 @@ class PptParser(object): |
| 1429 | 1428 | else: |
| 1430 | 1429 | log.info('storage is ok; compressed={}, size={}, ' |
| 1431 | 1430 | 'size_decomp={}' |
| 1432 | - .format(storage.compressed, | |
| 1431 | + .format(storage.is_compressed, | |
| 1433 | 1432 | storage.rec_head.rec_len, |
| 1434 | 1433 | storage.uncompressed_size)) |
| 1435 | 1434 | storages.append(storage) | ... | ... |