From 454ca224a8c4666a7b0541e3ab3af08c608fa9d3 Mon Sep 17 00:00:00 2001 From: Gregy Date: Sat, 7 Aug 2010 21:52:56 +0200 Subject: Log doesn't crash on empty line --- module/web/pyload/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 2c58f021a..58d1991ae 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -221,9 +221,12 @@ def logs(request, item=-1): counter = counter+1; if counter >= item: - date,time,level,message = l.split(" ", 3) - dtime = datetime.strptime(date+' '+time, '%d.%m.%Y %H:%M:%S') - + try: + date,time,level,message = l.split(" ", 3) + dtime = datetime.strptime(date+' '+time, '%d.%m.%Y %H:%M:%S') + except: + dtime = datetime.strptime('01.01.3333 12:12:12', '%d.%m.%Y %H:%M:%S') + message = l; if item == -1 and fro <= dtime: item = counter #found our datetime if item >= 0: -- cgit v1.2.3 From 5db6490dcbfc2806085556953babf2b128d84e3a Mon Sep 17 00:00:00 2001 From: Gregy Date: Sat, 7 Aug 2010 21:59:16 +0200 Subject: More log fixes --- module/web/pyload/views.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 58d1991ae..082882147 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -226,6 +226,9 @@ def logs(request, item=-1): dtime = datetime.strptime(date+' '+time, '%d.%m.%Y %H:%M:%S') except: dtime = datetime.strptime('01.01.3333 12:12:12', '%d.%m.%Y %H:%M:%S') + date = '?' + time = ' ' + level = '?' message = l; if item == -1 and fro <= dtime: item = counter #found our datetime -- cgit v1.2.3