added .system to get info on the host system

This commit is contained in:
lukeroge 2012-03-28 12:22:43 +13:00
parent b35868c0f1
commit 2f492a4659

View file

@ -1,6 +1,7 @@
import re
import socket
import subprocess
import platform
import time
from util import hook, http
@ -60,3 +61,12 @@ def onjoin(paraml, conn=None, bot=None):
while True:
time.sleep(delay)
conn.cmd('PING', [conn.nick])
# system info command
@hook.command(autohelp=False)
def system(inp):
".system -- retrieves information about the host system"
python_version = platform.python_version()
os = platform.platform(aliased=True)
cpu = platform.machine()
return "Platform: %s, Python Version: %s, CPU: %s" % (os, python_version, cpu)