diff options
Diffstat (limited to 'module/web/pyload/views.py')
-rw-r--r-- | module/web/pyload/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 37470c98f..9d3b6dd29 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -148,7 +148,10 @@ def logs(request, page=0): log = file(join(settings.LOG_ROOT, "log.txt")).readlines() data = [] page = int(page) - for i in range(page, page + 20): - data.append({'line': i + 1, 'content':log[i]}) + try: + for i in range(page, page + 20): + data.append({'line': i + 1, 'content':log[i]}) + except: + pass return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) |