Commit 4294724c authored by Pratap Vardhan's avatar Pratap Vardhan
Browse files

FIX: lint errors

parent b208ba82
Pipeline #114232 passed with stages
in 41 seconds
...@@ -18,7 +18,7 @@ const apis = { ...@@ -18,7 +18,7 @@ const apis = {
pdftojson: function (opts) { pdftojson: function (opts) {
return $.getJSON('./pdftojson', {filename: opts.filename}) return $.getJSON('./pdftojson', {filename: opts.filename})
.done(data => $(window).trigger('data-table', data)) .done(data => $(window).trigger('data-table', data))
.fail(() => console.log('ERROR: pdftojson')) .fail(() => console.log('ERROR: pdftojson')) // eslint-disable-line no-console
} }
} }
// setup elements // setup elements
......
...@@ -2,6 +2,7 @@ from io import StringIO ...@@ -2,6 +2,7 @@ from io import StringIO
import logging import logging
import pandas as pd import pandas as pd
import camelot import camelot
from gramex.http import BAD_REQUEST
logging.getLogger('pdfminer').setLevel(logging.ERROR) logging.getLogger('pdfminer').setLevel(logging.ERROR)
...@@ -23,7 +24,7 @@ def extract_table(path): ...@@ -23,7 +24,7 @@ def extract_table(path):
def pdftojson(handler): def pdftojson(handler):
filename = handler.args.get('filename', [False])[0] filename = handler.args.get('filename', [False])[0]
if not filename: if not filename:
return handler.set_status(400) return handler.set_status(BAD_REQUEST)
result = extract_table(handler.kwargs.path + filename) result = extract_table(handler.kwargs.path + filename)
return { return {
'data': result['df'].to_dict(orient='r'), 'data': result['df'].to_dict(orient='r'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment