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) print(err)
return misperrors return misperrors
doc_content = "" doc_content = ""
doc_file = io.BytesIO(docx_array) doc_file = io.BytesIO(docx_array)
try: try:
doc = docx.Document(doc_file) doc = docx.Document(doc_file)

View File

@ -29,14 +29,14 @@ def handler(q=False):
print(err) print(err)
return misperrors return misperrors
ods_content = "" ods_content = ""
ods_file = io.BytesIO(ods_array) ods_file = io.BytesIO(ods_array)
doc = ezodf.opendoc(ods_file) doc = ezodf.opendoc(ods_file)
num_sheets = len(doc.sheets) num_sheets = len(doc.sheets)
try: try:
for i in range(0, num_sheets): for i in range(0, num_sheets):
ods = pandas_ods_reader.read_ods(ods_file, i, headers=False) 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) print(ods_content)
return {'results': [{'types': ['freetext'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename}, 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}]} {'types': ['text'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename}]}

View File

@ -28,7 +28,7 @@ def handler(q=False):
print(err) print(err)
return misperrors return misperrors
odt_content = "" odt_content = ""
odt_file = io.BytesIO(odt_array) odt_file = io.BytesIO(odt_array)
try: try:
odt_content = odtToText(odt_file) odt_content = odtToText(odt_file)

View File

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

View File

@ -28,7 +28,7 @@ def handler(q=False):
print(err) print(err)
return misperrors return misperrors
ppt_content = "" ppt_content = ""
ppt_file = io.BytesIO(pptx_array) ppt_file = io.BytesIO(pptx_array)
try: try:
ppt = Presentation(ppt_file) ppt = Presentation(ppt_file)

View File

@ -1,7 +1,7 @@
import json import json
import binascii import binascii
import np import np
import pandas import pandas
import io import io
misperrors = {'error': 'Error'} misperrors = {'error': 'Error'}
@ -28,12 +28,12 @@ def handler(q=False):
print(err) print(err)
return misperrors return misperrors
xls_content = "" xls_content = ""
xls_file = io.BytesIO(xlsx_array) xls_file = io.BytesIO(xlsx_array)
pandas.set_option('display.max_colwidth', -1) pandas.set_option('display.max_colwidth', -1)
try: try:
xls = pandas.read_excel(xls_file) 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) print(xls_content)
return {'results': [{'types': ['freetext'], 'values': xls_content, 'comment': ".xlsx-to-text from file " + filename}, 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}]} {'types': ['text'], 'values': xls_content, 'comment': ".xlsx-to-text from file " + filename}]}