From 84e18617d885a6a72dbd9e727161190d5abed9bb Mon Sep 17 00:00:00 2001 From: neersighted Date: Fri, 30 Mar 2012 09:17:31 -0700 Subject: [PATCH] reprdered code, added .pid --- plugins/system.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/system.py b/plugins/system.py index 2c58f0f..128c0f6 100755 --- a/plugins/system.py +++ b/plugins/system.py @@ -20,6 +20,17 @@ def checkProc(checked_stats): stats = '\x02, '.join(key + ': \x02' + status[key] for key in checked_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(autohelp=False) def mem(inp): @@ -51,13 +62,6 @@ def uptime(inp): up_time = time.strftime("Uptime: \x02%M:%S\x02", up_time) return up_time - - -@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) +def pid(inp): + return 'PID: \x02%s\x02' % os.getpid()