From 1f8ba2dfe5eedd28badcd0afa348d31a7fccde25 Mon Sep 17 00:00:00 2001 From: Jorge Gorbe Moya Date: Mon, 30 Jun 2008 16:50:51 +0200 Subject: [PATCH] Various fixes in viewer --- melon-view.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/melon-view.py b/melon-view.py index 16a0583..6d0a143 100755 --- a/melon-view.py +++ b/melon-view.py @@ -29,7 +29,7 @@ def get_app_info(filename): if l[:2]=='!!' and l[-2:]=='!!': last_complete_line = l l = last_complete_line[2:-2].split("&") - return AppInfo(l[0],l[1],l[2],l[3],int(l[4])) + return AppInfo(l[0],l[1],l[2],l[3],int(float(l[4]))) def get_apps_info(): @@ -37,7 +37,7 @@ def get_apps_info(): for dir in log_dirs: filenames = os.listdir(dir) for f in filenames: - if f[-6:] == ".melon": + if f[:6] == "melon-": apps.append(get_app_info(dir+os.sep+f)) return apps @@ -80,7 +80,7 @@ while not exit: attribs = curses.A_NORMAL stdscr.addstr(3*i+1, 2, app.name, attribs) stdscr.addstr(3*i+1, 65, (app.user+"@"+app.machine)[:barsize], attribs) - stdscr.addstr(3*i+2, 2, app.status[cur_x_pos:], attribs) + stdscr.addstr(3*i+2, 2, app.status[cur_x_pos:cur_x_pos+57], attribs) stdscr.hline(3*i+2, 65, "-", barsize) stdscr.hline(3*i+2, 65, "+", int((app.progress/100.0)*barsize)) -- 2.34.1