Correct action for 2 steps ad-hoc commands

darcs-hash:20070913185546-86b55-5571bac7091a938d3b840fceab1455a135298d76.gz
This commit is contained in:
David Rousselie
2007-09-13 20:55:46 +02:00
parent 41628a2c65
commit 32a1f6b7e2
2 changed files with 17 additions and 18 deletions

View File

@@ -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)

View File

@@ -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"})