removed trailing whitespaces

pull/302/head
Sascha Rommelfangen 2019-04-26 12:14:56 +02:00
parent 722ec88b45
commit fc339c888d
6 changed files with 9 additions and 9 deletions

View File

@ -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)

View 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}]}

View File

@ -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)

View File

@ -2,7 +2,7 @@ import json
import binascii
import np
import pytesseract
import pdftotext
import pdftotext
import io
import collections

View File

@ -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)

View 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}]}