- Timestamp:
- Oct 9, 2007, 11:21:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/main.py
r166 r167 700 700 main_status = dict(name=machine.name, 701 701 memory=str(machine.memory)) 702 uptime=None 703 cputime=None 702 704 else: 703 705 main_status = dict(status[1:]) 704 start_time = float(main_status.get('start_time', 0))705 uptime = datetime.timedelta(seconds=int(time.time()-start_time))706 cpu_time_float = float(main_status.get('cpu_time', 0))707 cputime = datetime.timedelta(seconds=int(cpu_time_float))706 start_time = float(main_status.get('start_time', 0)) 707 uptime = datetime.timedelta(seconds=int(time.time()-start_time)) 708 cpu_time_float = float(main_status.get('cpu_time', 0)) 709 cputime = datetime.timedelta(seconds=int(cpu_time_float)) 708 710 display_fields = """name uptime memory state cpu_weight on_reboot 709 711 on_poweroff on_crash on_xend_start on_xend_stop bootloader""".split() … … 743 745 main_status['memory'] += ' MB' 744 746 for field, disp in display_fields: 745 if field in ('uptime', 'cputime') :747 if field in ('uptime', 'cputime') and locals()[field] is not None: 746 748 fields.append((disp, locals()[field])) 747 749 elif field in machine_info:
Note: See TracChangeset
for help on using the changeset viewer.