Clean up the on_enter methods. fixed #2101

This commit is contained in:
Florent Le Coz 2011-01-12 17:19:14 +01:00
parent 2aa799fc26
commit 22ad96e7aa

View file

@ -95,7 +95,7 @@ class Tab(object):
return True
return False
def on_enter(self, provided_text=None):
def execute_command(self, provided_text):
"""
Execute the command in the input and return False if
the input didn't contain a command
@ -246,7 +246,7 @@ class ChatTab(Tab):
def on_enter(self):
txt = self.input.key_enter()
if not Tab.on_enter(self, txt):
if not self.execute_command(txt):
self.command_say(txt)
def command_say(self, line):
@ -306,6 +306,9 @@ class InfoTab(ChatTab):
self.input.do_command(key)
return False
def on_enter(self):
self.execute_command(self.input_enter_key())
def on_lose_focus(self):
self.color_state = theme.COLOR_TAB_NORMAL
@ -915,7 +918,7 @@ class RosterInfoTab(Tab):
def execute_slash_command(self, txt):
if txt.startswith('/'):
Tab.on_enter(self, txt)
self.execute_command(txt)
return self.reset_help_message()
def on_lose_focus(self):