mirror of https://github.com/MISP/misp-modules
removed trailing whitespaces
parent
722ec88b45
commit
fc339c888d
|
@ -28,7 +28,7 @@ def handler(q=False):
|
|||
print(err)
|
||||
return misperrors
|
||||
|
||||
doc_content = ""
|
||||
doc_content = ""
|
||||
doc_file = io.BytesIO(docx_array)
|
||||
try:
|
||||
doc = docx.Document(doc_file)
|
||||
|
|
|
@ -29,14 +29,14 @@ def handler(q=False):
|
|||
print(err)
|
||||
return misperrors
|
||||
|
||||
ods_content = ""
|
||||
ods_content = ""
|
||||
ods_file = io.BytesIO(ods_array)
|
||||
doc = ezodf.opendoc(ods_file)
|
||||
num_sheets = len(doc.sheets)
|
||||
try:
|
||||
for i in range(0, num_sheets):
|
||||
ods = pandas_ods_reader.read_ods(ods_file, i, headers=False)
|
||||
ods_content = ods_content + "\n" + ods.to_string(max_rows=None)
|
||||
ods_content = ods_content + "\n" + ods.to_string(max_rows=None)
|
||||
print(ods_content)
|
||||
return {'results': [{'types': ['freetext'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename},
|
||||
{'types': ['text'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename}]}
|
||||
|
|
|
@ -28,7 +28,7 @@ def handler(q=False):
|
|||
print(err)
|
||||
return misperrors
|
||||
|
||||
odt_content = ""
|
||||
odt_content = ""
|
||||
odt_file = io.BytesIO(odt_array)
|
||||
try:
|
||||
odt_content = odtToText(odt_file)
|
||||
|
|
|
@ -2,7 +2,7 @@ import json
|
|||
import binascii
|
||||
import np
|
||||
import pytesseract
|
||||
import pdftotext
|
||||
import pdftotext
|
||||
import io
|
||||
import collections
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ def handler(q=False):
|
|||
print(err)
|
||||
return misperrors
|
||||
|
||||
ppt_content = ""
|
||||
ppt_content = ""
|
||||
ppt_file = io.BytesIO(pptx_array)
|
||||
try:
|
||||
ppt = Presentation(ppt_file)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
import binascii
|
||||
import np
|
||||
import pandas
|
||||
import pandas
|
||||
import io
|
||||
|
||||
misperrors = {'error': 'Error'}
|
||||
|
@ -28,12 +28,12 @@ def handler(q=False):
|
|||
print(err)
|
||||
return misperrors
|
||||
|
||||
xls_content = ""
|
||||
xls_content = ""
|
||||
xls_file = io.BytesIO(xlsx_array)
|
||||
pandas.set_option('display.max_colwidth', -1)
|
||||
try:
|
||||
xls = pandas.read_excel(xls_file)
|
||||
xls_content = xls.to_string(max_rows=None)
|
||||
xls_content = xls.to_string(max_rows=None)
|
||||
print(xls_content)
|
||||
return {'results': [{'types': ['freetext'], 'values': xls_content, 'comment': ".xlsx-to-text from file " + filename},
|
||||
{'types': ['text'], 'values': xls_content, 'comment': ".xlsx-to-text from file " + filename}]}
|
||||
|
|
Loading…
Reference in New Issue