From: Laurent Bachelier Date: Wed, 3 Oct 2012 19:54:56 +0000 (+0200) Subject: Use existing shell quote function X-Git-Tag: 1.6~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0a7af36fe787710c17f2a74be1254e37c064c949;p=irker.git Use existing shell quote function Signed-off-by: Eric S. Raymond --- diff --git a/irkerhook.py b/irkerhook.py index 40bc155..ee9b671 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -38,12 +38,10 @@ default_channels = "irc://chat.freenode.net/%(project)s,irc://chat.freenode.net/ # import os, sys, commands, socket, urllib, json +from pipes import quote as shellquote version = "1.5" -def shellquote(s): - return "'" + s.replace("'","'\\''") + "'" - def do(command): return commands.getstatusoutput(command)[1]