Browse Source

Replace Python 2.7+ timedelta call with code that also works in older versions

develop
Sven Slootweg 9 years ago
parent
commit
42cb26f273
  1. 4
      script/daemon.py

4
script/daemon.py

@ -33,8 +33,10 @@ def generate_stats(get_processes):
"free": usage.free
}
uptime = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME))
return_data = {
"uptime": (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).total_seconds(),
"uptime": (uptime.microseconds + (uptime.seconds + uptime.days * 24 * 3600) * 10**6) / 10**6,
"memory": {
"total": mem.total,
"available": mem.available,

Loading…
Cancel
Save