summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-04-18 00:10:10 +0200
committermathieui <mathieui@mathieui.net>2012-04-18 00:10:10 +0200
commit22cd80feb52d539e8aef5a252c75f75cf1f04c5b (patch)
treee0f663a5c3bddc4a89b0935a1245e9fdb14e21a0
parent54a43ab13209721129b961cc7dfb441a70cf7cb5 (diff)
downloadpoezio-22cd80feb52d539e8aef5a252c75f75cf1f04c5b.tar.gz
poezio-22cd80feb52d539e8aef5a252c75f75cf1f04c5b.tar.bz2
poezio-22cd80feb52d539e8aef5a252c75f75cf1f04c5b.tar.xz
poezio-22cd80feb52d539e8aef5a252c75f75cf1f04c5b.zip
Refactor command_win a bit
-rw-r--r--src/core.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core.py b/src/core.py
index c36531c0..13eea3e1 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1621,14 +1621,14 @@ class Core(object):
"""
/win <number>
"""
- args = arg.split()
- if len(args) != 1:
+ arg = arg.strip()
+ if not arg:
self.command_help('win')
return
try:
- nb = int(args[0])
+ nb = int(arg.split()[0])
except ValueError:
- nb = arg.strip()
+ nb = arg
if self.current_tab().nb == nb:
return
self.previous_tab_nb = self.current_tab().nb