divmod-dev team mailing list archive
-
divmod-dev team
-
Mailing list archive
-
Message #00422
[Merge] lp:~exarkun/divmod.org/actions-commands-1189159 into lp:divmod.org
Jean-Paul Calderone has proposed merging lp:~exarkun/divmod.org/actions-commands-1189159 into lp:divmod.org.
Requested reviews:
Divmod-dev (divmod-dev)
Related bugs:
Bug #1189159 in Divmod Imaginary: "It is hard to find the "actions" command and the "actions" command is misdocumented"
https://bugs.launchpad.net/imaginary/+bug/1189159
For more details, see:
https://code.launchpad.net/~exarkun/divmod.org/actions-commands-1189159/+merge/168297
This adds a "commands" action and help text, both of which direct the user at the "actions" action.
--
https://code.launchpad.net/~exarkun/divmod.org/actions-commands-1189159/+merge/168297
Your team Divmod-dev is requested to review the proposed merge of lp:~exarkun/divmod.org/actions-commands-1189159 into lp:divmod.org.
=== modified file 'Imaginary/imaginary/action.py'
--- Imaginary/imaginary/action.py 2009-08-18 00:20:31 +0000
+++ Imaginary/imaginary/action.py 2013-06-09 18:23:25 +0000
@@ -1034,6 +1034,21 @@
+class Commands(Action):
+ """
+ The I{commands} action provides a pointer to inexperienced players that
+ they should be thinking in terms of I{actions} instead.
+
+ This has no world side-effects; it just provides some user-interface
+ information to the player.
+ """
+ expr = pyparsing.Literal("commands")
+
+ def do(self, player, line):
+ player.send("Try 'actions' instead.")
+
+
+
class Search(Action):
expr = (pyparsing.Literal("search") +
targetString("name"))
=== modified file 'Imaginary/imaginary/resources/help/actions'
--- Imaginary/imaginary/resources/help/actions 2007-08-17 04:46:38 +0000
+++ Imaginary/imaginary/resources/help/actions 2013-06-09 18:23:25 +0000
@@ -1,5 +1,5 @@
-COMMANDS
-
-Usage: commands
-
-List all commands available to you.
+ACTIONS
+
+Usage: actions
+
+List all actions available to you.
=== added file 'Imaginary/imaginary/resources/help/commands'
--- Imaginary/imaginary/resources/help/commands 1970-01-01 00:00:00 +0000
+++ Imaginary/imaginary/resources/help/commands 2013-06-09 18:23:25 +0000
@@ -0,0 +1,3 @@
+COMMANDS
+
+See: help actions
=== modified file 'Imaginary/imaginary/test/test_actions.py'
--- Imaginary/imaginary/test/test_actions.py 2009-08-17 02:40:03 +0000
+++ Imaginary/imaginary/test/test_actions.py 2013-06-09 18:23:25 +0000
@@ -101,7 +101,11 @@
"barbaz",
"barbaz"])
- def testActions(self):
+
+ def test_actions(self):
+ """
+ The I{actions} action lists all of the actions a character can take.
+ """
cmds = dict.fromkeys([
getattr(cls, 'actionName', cls.__name__.lower())
for cls
@@ -111,6 +115,18 @@
"actions",
[' '.join(cmds)])
+
+ def test_commands(self):
+ """
+ The I{commands} action is a stub to help those unfamiliar with
+ Imaginary's action system find their way to the I{actions} command
+ instead.
+ """
+ self._test(
+ "commands",
+ ["Try 'actions' instead."])
+
+
def testGet(self):
# Try to get something that does not exist
self._test(
Follow ups