Commit 55b75d0c1642f59ab8b0fcc5d167f4c4d238c95b

Authored by Christian Herdtweck
1 parent e07a649f

wrap long lines

Showing 1 changed file with 17 additions and 9 deletions
oletools/ppt_parser.py
... ... @@ -133,7 +133,7 @@ class RecordHeader(object):
133 133 obj.rec_instance, obj.rec_ver = divmod(version_instance, 2**4)
134 134 obj.rec_type, = struct.unpack('<H', stream.read(2))
135 135 obj.rec_len, = struct.unpack('<L', stream.read(4))
136   - #log.debug('type is {0:04X}, instance {1:04X}, version {2:04X}, len {3}'
  136 + #log.debug('type is {0:04X}, instance {1:04X}, version {2:04X},len {3}'
137 137 # .format(obj.rec_type, obj.rec_instance, obj.rec_ver,
138 138 # obj.rec_len))
139 139 return obj
... ... @@ -743,20 +743,23 @@ class DocumentContainer(PptType):
743 743 # specifies size information for presentation slides and notes slides.
744 744 obj.document_atom = DummyType('DocumentAtom', 0x03E9, rec_ver=0x1,
745 745 rec_len=0x28).extract_from(stream)
746   - log.info('validity: {} errs'.format(len(obj.document_atom.check_validity())))
  746 + log.info('validity: {} errs'
  747 + .format(len(obj.document_atom.check_validity())))
747 748  
748 749 # exObjList (variable): An optional ExObjListContainer record (section
749 750 # 2.10.1) that specifies the list of external objects in the document.
750 751 obj.ex_obj_list = DummyType('ExObjListContainer', 0x0409, rec_ver=0xF)\
751 752 .extract_from(stream)
752   - log.info('validity: {} errs'.format(len(obj.ex_obj_list.check_validity())))
  753 + log.info('validity: {} errs'
  754 + .format(len(obj.ex_obj_list.check_validity())))
753 755  
754 756 # documentTextInfo (variable): A DocumentTextInfoContainer record
755 757 # (section 2.9.1) that specifies the default text styles for the
756 758 # document.
757 759 obj.document_text_info = DummyType('DocumentTextInfoContainer', 0x03F2,
758 760 rec_ver=0xF).extract_from(stream)
759   - log.info('validity: {} errs'.format(len(obj.document_text_info.check_validity())))
  761 + log.info('validity: {} errs'
  762 + .format(len(obj.document_text_info.check_validity())))
760 763  
761 764 # soundCollection (variable): An optional SoundCollectionContainer
762 765 # record (section 2.4.16.1) that specifies the list of sounds in the
... ... @@ -764,20 +767,23 @@ class DocumentContainer(PptType):
764 767 obj.sound_collection = DummyType('SoundCollectionContainer', 0x07E4,
765 768 rec_ver=0xF, rec_instance=0x005)\
766 769 .extract_from(stream)
767   - log.info('validity: {} errs'.format(len(obj.sound_collection.check_validity())))
  770 + log.info('validity: {} errs'
  771 + .format(len(obj.sound_collection.check_validity())))
768 772  
769 773 # drawingGroup (variable): A DrawingGroupContainer record (section
770 774 # 2.4.3) that specifies drawing information for the document.
771 775 obj.drawing_group = DummyType('DrawingGroupContainer', 0x040B,
772 776 rec_ver=0xF).extract_from(stream)
773   - log.info('validity: {} errs'.format(len(obj.drawing_group.check_validity())))
  777 + log.info('validity: {} errs'
  778 + .format(len(obj.drawing_group.check_validity())))
774 779  
775 780 # masterList (variable): A MasterListWithTextContainer record (section
776 781 # 2.4.14.1) that specifies the list of main master slides and title
777 782 # master slides.
778 783 obj.master_list = DummyType('MasterListWithContainer', 0x0FF0,
779 784 rec_ver=0xF).extract_from(stream)
780   - log.info('validity: {} errs'.format(len(obj.master_list.check_validity())))
  785 + log.info('validity: {} errs'
  786 + .format(len(obj.master_list.check_validity())))
781 787  
782 788 # docInfoList (variable): An optional DocInfoListContainer record
783 789 # (section 2.4.4) that specifies additional document information.
... ... @@ -1364,7 +1370,8 @@ class PptParser(object):
1364 1370  
1365 1371 errs = container.check_validity()
1366 1372 if errs:
1367   - log.warning('check_validity found {} issues'.format(len(errs)))
  1373 + log.warning('check_validity found {} issues'
  1374 + .format(len(errs)))
1368 1375 else:
1369 1376 log.debug('container is ok')
1370 1377 atom = container.vba_info_atom
... ... @@ -1562,7 +1569,8 @@ def test():
1562 1569 for storage in storages:
1563 1570 parser = VBA_Parser(None, ppt.decompress_vba_storage(storage),
1564 1571 container='PptParser')
1565   - for vba_root, project_path, dir_path in parser.find_vba_projects():
  1572 + for vba_root, project_path, dir_path in \
  1573 + parser.find_vba_projects():
1566 1574 log.info('found vba project: root={}, proj={}, dir={}'
1567 1575 .format(vba_root, project_path, dir_path))
1568 1576 for subfilename, stream_path, vba_filename, vba_code in \
... ...