Skip to content

Commit

Permalink
(fixes buildbot#220) use shlex.split everywhere in the IRC bot
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Dec 19, 2009
1 parent 79b289d commit 0c51ff9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions buildbot/status/words.py
Expand Up @@ -136,7 +136,7 @@ def command_VERSION(self, args, who):
self.send("buildbot-%s at your service" % version)

def command_LIST(self, args, who):
args = args.split()
args = slex.split(args)
if len(args) == 0:
raise UsageError, "try 'list builders'"
if args[0] == 'builders':
Expand All @@ -154,7 +154,7 @@ def command_LIST(self, args, who):
command_LIST.usage = "list builders - List configured builders"

def command_STATUS(self, args, who):
args = args.split()
args = slex.split(args)
if len(args) == 0:
which = "all"
elif len(args) == 1:
Expand Down Expand Up @@ -213,7 +213,7 @@ def remove_all_notification_events(self):
self.unsubscribe_from_build_events()

def command_NOTIFY(self, args, who):
args = args.split()
args = slex.split(args)

if not args:
raise UsageError("try 'notify on|off|list <EVENT>'")
Expand Down Expand Up @@ -244,7 +244,7 @@ def command_NOTIFY(self, args, who):
command_NOTIFY.usage = "notify on|off|list [<EVENT>] ... - Notify me about build events. event should be one or more of: 'started', 'finished', 'failure', 'success', 'exception' or 'xToY' (where x and Y are one of success, warnings, failure, exception, but Y is capitalized)"

def command_WATCH(self, args, who):
args = args.split()
args = slex.split(args)
if len(args) != 1:
raise UsageError("try 'watch <builder>'")
which = args[0]
Expand Down Expand Up @@ -432,7 +432,7 @@ def command_FORCE(self, args, who):
command_FORCE.usage = "force build <which> <reason> - Force a build"

def command_STOP(self, args, who):
args = args.split(None, 2)
args = slex.split(args)
if len(args) < 3 or args[0] != 'build':
raise UsageError, "try 'stop build WHICH <REASON>'"
which = args[1]
Expand Down Expand Up @@ -498,7 +498,7 @@ def emit_last(self, which):
self.send("last build [%s]: %s" % (which, str))

def command_LAST(self, args, who):
args = args.split()
args = slex.split(args)
if len(args) == 0:
which = "all"
elif len(args) == 1:
Expand All @@ -522,7 +522,7 @@ def build_commands(self):
return commands

def command_HELP(self, args, who):
args = args.split()
args = slex.split(args)
if len(args) == 0:
self.send("Get help on what? (try 'help <foo>', or 'commands' for a command list)")
return
Expand Down Expand Up @@ -601,14 +601,14 @@ def act(self, action):
self.channel.me(self.dest, action.encode("ascii", "replace"))

def command_JOIN(self, args, who):
args = args.split()
args = slex.split(args)
to_join = args[0]
self.channel.join(to_join)
self.send("Joined %s" % to_join)
command_JOIN.usage = "join channel - Join another channel"

def command_LEAVE(self, args, who):
args = args.split()
args = slex.split(args)
to_leave = args[0]
self.send("Buildbot has been told to leave %s" % to_leave)
self.channel.part(to_leave)
Expand Down

0 comments on commit 0c51ff9

Please sign in to comment.