From 32a1f6b7e2d0aa82647d7f7541012e7a2d73d14a Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Thu, 13 Sep 2007 20:55:46 +0200 Subject: [PATCH] Correct action for 2 steps ad-hoc commands darcs-hash:20070913185546-86b55-5571bac7091a938d3b840fceab1455a135298d76.gz --- src/jcl/jabber/command.py | 14 +++++++------- src/jcl/jabber/tests/command.py | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/jcl/jabber/command.py b/src/jcl/jabber/command.py index 4801c8d..f953ace 100644 --- a/src/jcl/jabber/command.py +++ b/src/jcl/jabber/command.py @@ -363,7 +363,7 @@ class JCLCommandManager(CommandManager): return result_form def add_form_select_max(self, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result") result_form.add_field(field_type="hidden", name="FORM_TYPE", @@ -880,7 +880,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_announce_1(self, info_query, session_context, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_announce, instructions=lang_class.command_announce_1_description) @@ -915,7 +915,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_set_motd_1(self, info_query, session_context, command_node, lang_class, motd=""): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_set_motd, instructions=lang_class.command_set_motd_1_description) @@ -981,7 +981,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_set_welcome_1(self, info_query, session_context, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_set_welcome, instructions=lang_class.command_set_welcome_1_description) @@ -1020,7 +1020,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_edit_admin_1(self, info_query, session_context, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_edit_admin, instructions=lang_class.command_edit_admin_1_description) @@ -1049,7 +1049,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_restart_1(self, info_query, session_context, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_restart, instructions=lang_class.command_restart_1_description) @@ -1110,7 +1110,7 @@ class JCLCommandManager(CommandManager): ########################################################################### def execute_shutdown_1(self, info_query, session_context, command_node, lang_class): - self.add_actions(command_node, [ACTION_NEXT]) + self.add_actions(command_node, [ACTION_COMPLETE]) result_form = Form(xmlnode_or_type="result", title=lang_class.command_shutdown, instructions=lang_class.command_shutdown_1_description) diff --git a/src/jcl/jabber/tests/command.py b/src/jcl/jabber/tests/command.py index 563c06d..5617d6f 100644 --- a/src/jcl/jabber/tests/command.py +++ b/src/jcl/jabber/tests/command.py @@ -712,7 +712,6 @@ class JCLCommandManager_TestCase(JCLTestCase): name="test_int", value="42") submit_form.as_xml(command_node) - result = self.command_manager.apply_command_action(info_query, "http://jabber.org/protocol/admin#add-user", "prev") @@ -1908,7 +1907,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2080,7 +2079,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2251,7 +2250,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2368,7 +2367,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2452,7 +2451,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2538,7 +2537,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2672,7 +2671,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2802,7 +2801,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -2888,7 +2887,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"}) @@ -3039,7 +3038,7 @@ class JCLCommandManager_TestCase(JCLTestCase): {"c": "http://jabber.org/protocol/commands"})[0] self.assertEquals(xml_command.prop("status"), "executing") self.assertNotEquals(xml_command.prop("sessionid"), None) - self.__check_actions(result[0], ["next"]) + self.__check_actions(result[0], ["complete"]) fields = result[0].xpath_eval("c:command/data:x/data:field", {"c": "http://jabber.org/protocol/commands", "data": "jabber:x:data"})