Commit 830f098b36ed6cfa3f4d422f1e39d7a65aab4308

Authored by decalage2
1 parent 2f7a1ef1

msodde: added comments

Showing 1 changed file with 2 additions and 0 deletions
oletools/msodde.py
@@ -779,6 +779,7 @@ def process_csv(filepath): @@ -779,6 +779,7 @@ def process_csv(filepath):
779 else: 779 else:
780 open_arg = dict(newline='') 780 open_arg = dict(newline='')
781 with open(filepath, **open_arg) as file_handle: 781 with open(filepath, **open_arg) as file_handle:
  782 + # TODO: here we should not assume this is a file on disk, filepath can be a file object
782 results, dialect = process_csv_dialect(file_handle, CSV_DELIMITERS) 783 results, dialect = process_csv_dialect(file_handle, CSV_DELIMITERS)
783 is_small = file_handle.tell() < CSV_SMALL_THRESH 784 is_small = file_handle.tell() < CSV_SMALL_THRESH
784 785
@@ -877,6 +878,7 @@ def process_file(filepath, field_filter_mode=None): @@ -877,6 +878,7 @@ def process_file(filepath, field_filter_mode=None):
877 return process_doc(ole) 878 return process_doc(ole)
878 879
879 with open(filepath, 'rb') as file_handle: 880 with open(filepath, 'rb') as file_handle:
  881 + # TODO: here we should not assume this is a file on disk, filepath can be a file object
880 if file_handle.read(4) == RTF_START: 882 if file_handle.read(4) == RTF_START:
881 logger.debug('Process file as rtf') 883 logger.debug('Process file as rtf')
882 return process_rtf(file_handle, field_filter_mode) 884 return process_rtf(file_handle, field_filter_mode)