support 'next' action when applying commands
darcs-hash:20071008192810-86b55-f529492d795ef403f19112cee9b83a764a97db52.gz
This commit is contained in:
@@ -121,12 +121,16 @@ class CommandManager(object):
|
||||
return getattr(self, action_command_method)(info_query,
|
||||
short_command_name)
|
||||
else:
|
||||
self.__logger.error("Action '" + str(action) + "' unknown")
|
||||
return [info_query.make_error_response(\
|
||||
"feature-not-implemented")]
|
||||
else:
|
||||
self.__logger.error(unicode(info_query.get_from().bare()) + " must "
|
||||
+ "be in admin list")
|
||||
return [info_query.make_error_response(\
|
||||
"forbidden")]
|
||||
else:
|
||||
self.__logger.error("Command " + str(command_name) + " not found")
|
||||
return [info_query.make_error_response(\
|
||||
"feature-not-implemented")]
|
||||
|
||||
@@ -137,6 +141,8 @@ class CommandManager(object):
|
||||
lambda session_id: (self.sessions[session_id][0] + 1,
|
||||
self.sessions[session_id][1]))
|
||||
|
||||
apply_next_command = apply_execute_command
|
||||
|
||||
def apply_prev_command(self, info_query, short_command_name):
|
||||
return self.execute_multi_step_command(\
|
||||
info_query,
|
||||
@@ -205,6 +211,7 @@ class CommandManager(object):
|
||||
|
||||
def execute_multi_step_command(self, info_query, short_node,
|
||||
update_step_func):
|
||||
self.__logger.debug("Executing multi-step command " + str(short_node))
|
||||
(response,
|
||||
command_node,
|
||||
session_id) = self._create_response(info_query,
|
||||
|
||||
@@ -544,7 +544,7 @@ class JCLCommandManager_TestCase(JCLTestCase):
|
||||
submit_form.as_xml(command_node)
|
||||
result = self.command_manager.apply_command_action(info_query,
|
||||
"http://jabber.org/protocol/admin#add-user",
|
||||
"execute")
|
||||
"next")
|
||||
self.assertNotEquals(result, None)
|
||||
self.assertEquals(len(result), 1)
|
||||
xml_command = result[0].xpath_eval("c:command",
|
||||
|
||||
@@ -134,12 +134,23 @@ class Account(InheritableSQLObject):
|
||||
def get_error_status_msg(self, lang_class):
|
||||
return lang_class.account_error
|
||||
|
||||
get_online_status_msg = get_default_status_msg
|
||||
get_chat_status_msg = get_default_status_msg
|
||||
get_away_status_msg = get_default_status_msg
|
||||
get_xa_status_msg = get_disabled_status_msg
|
||||
get_dnd_status_msg = get_error_status_msg
|
||||
get_offline_status_msg = get_default_status_msg
|
||||
def get_online_status_msg(self, lang_class):
|
||||
return self.get_default_status_msg(lang_class)
|
||||
|
||||
def get_chat_status_msg(self, lang_class):
|
||||
return self.get_default_status_msg(lang_class)
|
||||
|
||||
def get_away_status_msg(self, lang_class):
|
||||
return self.get_default_status_msg(lang_class)
|
||||
|
||||
def get_xa_status_msg(self, lang_class):
|
||||
return self.get_disabled_status_msg(lang_class)
|
||||
|
||||
def get_dnd_status_msg(self, lang_class):
|
||||
return self.get_error_status_msg(lang_class)
|
||||
|
||||
def get_offline_status_msg(self, lang_class):
|
||||
return self.get_default_status_msg(lang_class)
|
||||
|
||||
def get_status(self):
|
||||
"""Return current Jabber status"""
|
||||
|
||||
Reference in New Issue
Block a user