diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-02-10 12:39:15 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-02-10 12:39:15 +0100 |
commit | 3dbb6590d3fab0ffb8ec7e66f0ecbe2701ce8d75 (patch) | |
tree | 516710779a129372e4dcf49eedf915948a5fb3db /src/tabs.py | |
parent | 538c843ec704fea18107f875aad0e14eebd1875e (diff) | |
download | poezio-3dbb6590d3fab0ffb8ec7e66f0ecbe2701ce8d75.tar.gz poezio-3dbb6590d3fab0ffb8ec7e66f0ecbe2701ce8d75.tar.bz2 poezio-3dbb6590d3fab0ffb8ec7e66f0ecbe2701ce8d75.tar.xz poezio-3dbb6590d3fab0ffb8ec7e66f0ecbe2701ce8d75.zip |
Make the shell split do a normal split if the syntax is wrong
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/tabs.py b/src/tabs.py index 5a27902e..70c02911 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -35,9 +35,9 @@ import windows import theme import curses import difflib -import shlex import text_buffer import string +import common from sleekxmpp.xmlstream.stanzabase import JID from config import config @@ -381,10 +381,7 @@ class MucTab(ChatTab): self.core.refresh_window() def command_info(self, arg): - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) != 1: return self.core.information("Info command takes only 1 argument") user = self.get_room().get_user_by_name(args[0]) @@ -442,10 +439,7 @@ class MucTab(ChatTab): """ /nick <nickname> """ - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) != 1: return nick = args[0] @@ -459,7 +453,6 @@ class MucTab(ChatTab): /part [msg] """ args = arg.split() - reason = None room = self.get_room() if len(args): msg = ' '.join(args) @@ -473,10 +466,7 @@ class MucTab(ChatTab): """ /query <nick> [message] """ - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) < 1: return nick = args[0] @@ -505,10 +495,7 @@ class MucTab(ChatTab): """ /kick <nick> [reason] """ - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) < 1: self.core.command_help('kick') return @@ -530,10 +517,7 @@ class MucTab(ChatTab): """ /ignore <nick> """ - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) != 1: self.core.command_help('ignore') return @@ -551,10 +535,7 @@ class MucTab(ChatTab): """ /unignore <nick> """ - try: - args = shlex.split(arg) - except ValueError as error: - return self.core.information(str(error), _("Error")) + args = common.shell_split(arg) if len(args) != 1: self.core.command_help('unignore') return |