Commit 9df280f3 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent 0ca61d97
......@@ -254,10 +254,10 @@ def getFileLog():
raise IOError
if not isText(file_path):
content = "Can not open binary file, please select a text file!"
if 'truncate' in request.form:
content = tail(open(file_path), int(request.form['truncate']))
else:
with open(file_path) as f:
with open(file_path) as f:
if 'truncate' in request.form:
content = tail(f, int(request.form['truncate']))
else:
content = f.read()
return jsonify(code=1, result=html_escape(content))
except Exception:
......
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