Commit b2feaa96 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Cleanup

parent 1acdcc82
......@@ -26,7 +26,7 @@ connect = ->
console.log 'msg', msg.data
data = JSON.parse(msg.data)
set('release', data.os) if data.os
set('release', data.release) if data.release
set('uptime', fmt_time(data.uptime)) if data.uptime
......
......@@ -43,7 +43,7 @@ def stats():
# Memory usage
with open('/proc/meminfo', 'r') as f:
for line in f.readlines():
for line in f:
if line.startswith('MemTotal'):
assert line.endswith('kB\n')
total = int(line.split()[1])
......@@ -62,6 +62,7 @@ def stats():
yield 'disk', (used, used + avail)
break
if __name__ == '__main__':
server = websocket(extensions=[WebkitDeflateFrame()])
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
......@@ -83,7 +84,6 @@ if __name__ == '__main__':
while True:
if not clients:
time.sleep(6)
#time.sleep(.1)
continue
status = Frame(OPCODE_TEXT, json.dumps(dict(stats())))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment