reprdered code, added .pid

This commit is contained in:
neersighted 2012-03-30 09:17:31 -07:00
parent 392b4b96c4
commit 84e18617d8

View file

@ -20,6 +20,17 @@ def checkProc(checked_stats):
stats = '\x02, '.join(key + ': \x02' + status[key] for key in checked_stats) stats = '\x02, '.join(key + ': \x02' + status[key] for key in checked_stats)
return stats return stats
@hook.command("system", autohelp=False)
@hook.command(autohelp=False)
def sys(inp):
".sys -- Retrieves information about the host system."
python_version = platform.python_version()
os = platform.platform(aliased=True)
cpu = platform.machine()
return "Platform: \x02%s\x02, Python Version: \x02%s\x02, CPU: \x02%s\x02" % (os, python_version, cpu)
@hook.command("memory", autohelp=False) @hook.command("memory", autohelp=False)
@hook.command(autohelp=False) @hook.command(autohelp=False)
def mem(inp): def mem(inp):
@ -51,13 +62,6 @@ def uptime(inp):
up_time = time.strftime("Uptime: \x02%M:%S\x02", up_time) up_time = time.strftime("Uptime: \x02%M:%S\x02", up_time)
return up_time return up_time
@hook.command("system", autohelp=False)
@hook.command(autohelp=False) @hook.command(autohelp=False)
def sys(inp): def pid(inp):
".sys -- Retrieves information about the host system." return 'PID: \x02%s\x02' % os.getpid()
python_version = platform.python_version()
os = platform.platform(aliased=True)
cpu = platform.machine()
return "Platform: \x02%s\x02, Python Version: \x02%s\x02, CPU: \x02%s\x02" % (os, python_version, cpu)