From a69e7fa510bfa3eba78c2f0339c75e510441688a Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Sat, 31 Mar 2012 12:46:10 +1300 Subject: [PATCH] We don't need multiple hooks, this thing has autosuggest/complete --- plugins/system.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/plugins/system.py b/plugins/system.py index 43cba6b..1389903 100755 --- a/plugins/system.py +++ b/plugins/system.py @@ -22,10 +22,9 @@ def checkProc(checked_stats): return stats -@hook.command("system", autohelp=False) @hook.command(autohelp=False) -def sys(inp): - ".sys -- Retrieves information about the host system." +def system(inp): + ".system -- Retrieves information about the host system." name = platform.node() os = platform.platform() python_version = platform.python_implementation() + ' ' + platform.python_version() @@ -34,10 +33,9 @@ def sys(inp): return 'Name: \x02%s\x02, Operating System: \x02%s\x02, Python Version: \x02%s\x02, Architecture: \x02%s\x02, CPU: \x02%s\x02' % (name, os, python_version, arch, cpu) -@hook.command("memory", autohelp=False) @hook.command(autohelp=False) -def mem(inp): - ".mem -- Displays the bot's current memory usage." +def memory(inp): + ".memory -- Displays the bot's current memory usage." if os.name == 'posix': checked_stats = 'VmRSS VmSize VmPeak VmStk VmData' memory = checkProc(checked_stats) @@ -65,15 +63,13 @@ def mem(inp): return memory -@hook.command("uptime", autohelp=False) @hook.command(autohelp=False) -def up(inp): - ".up -- Shows the bot's uptime." +def uptime(inp): + ".uptime -- Shows the bot's uptime." up_time = subprocess.check_output('ps -eo pid,etime | grep %s | awk \'{print $2}\'' % os.getpid(), shell=True) up_time = 'Uptime: \x02' + up_time + '\x02' return up_time -@hook.command("proc", autohelp=False) @hook.command(autohelp=False) def pid(inp): ".pid -- Prints the bot's PID."