Fixed PEP8 standards and other specified changes

This commit is contained in:
Hemanth Kumar Veeranki 2016-07-21 13:56:06 +05:30 committed by James Valleroy
parent 8d5ef42b73
commit 15a336613b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 11 additions and 7 deletions

View File

@ -72,13 +72,16 @@ def manual(request):
{'title': _('{box_name} Manual').format(box_name=_(cfg.box_name)),
'content': content})
def status_logs(request):
X = 100
file = open(cfg.status_log_file,"r")
data = file.readlines()
data = "".join(data[-X:])
""" Serves the last 100 lines of Status log"""
nr_lines = 100
logfile = open(cfg.status_log_file, "r")
data = logfile.readlines()
data = "".join(data[-nr_lines:])
context = {
"X":X,
"data":data
"nr_lines": nr_lines,
"data": data
}
logfile.close()
return TemplateResponse(request, "statuslog.html", context)

View File

@ -25,7 +25,8 @@
<p>
{% blocktrans trimmed %}
This is the last {{ X }} lines of status log Please attatch with the bug when raising a bug.
This is the last {{ nr_lines }} lines of status log.
If you want to report a bug use <a href="https://github.com/freedombox/Plinth/issues">bugtracker</a> and attach this status log with that.
<pre>{{ data }}</pre>
{% endblocktrans %}
</p>