From 17a4d8262cb23ca30ed1a376ea05dd4e5245f926 Mon Sep 17 00:00:00 2001 From: lukeroge Date: Thu, 29 Mar 2012 21:12:41 +1300 Subject: [PATCH] Added Windows catch --- plugins/ping.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/ping.py b/plugins/ping.py index c9424da..9710fd7 100755 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -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 [count] -- Pings [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: