Refactor command_win a bit

This commit is contained in:
mathieui 2012-04-18 00:10:10 +02:00
parent 54a43ab132
commit 22cd80feb5

View file

@ -1621,14 +1621,14 @@ class Core(object):
""" """
/win <number> /win <number>
""" """
args = arg.split() arg = arg.strip()
if len(args) != 1: if not arg:
self.command_help('win') self.command_help('win')
return return
try: try:
nb = int(args[0]) nb = int(arg.split()[0])
except ValueError: except ValueError:
nb = arg.strip() nb = arg
if self.current_tab().nb == nb: if self.current_tab().nb == nb:
return return
self.previous_tab_nb = self.current_tab().nb self.previous_tab_nb = self.current_tab().nb