Added Windows catch

This commit is contained in:
lukeroge 2012-03-29 21:12:41 +13:00
parent 7b21ffe065
commit 17a4d8262c

View file

@ -2,6 +2,7 @@
from util import hook
import subprocess
import re
import os
ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)")
@ -9,10 +10,14 @@ ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)")
@hook.command
def ping(inp, reply=None):
".ping <host> [count] -- Pings <host> [count] times."
if os.name == "nt":
return "Sorry, this command is not supported on Windows systems."
args = inp.split(' ')
host = args[0]
# check for a seccond argument and set the ping count
if len(args) > 1:
count = int(args[1])
if count > 20: