Created a state system. See

http://groups.google.com/group/evennia/browse_thread/thread/66a7ff6cce5303b7
for more detailed description.

Created a new folder gamesrc/commands/examples and moved all examples in there.
/Griatch
This commit is contained in:
Griatch 2009-05-01 15:34:43 +00:00
parent cae925c29b
commit 0efe2c3095
9 changed files with 415 additions and 30 deletions

View file

@ -1,6 +1,6 @@
"""
Command Table Module
---------------------
Each command entry consists of a key and a tuple containing a reference to the
command's function, and a tuple of the permissions to match against. The user
only need have one of the permissions in the permissions tuple to gain
@ -19,7 +19,7 @@ from src.helpsys.management.commands.edit_helpfiles import add_help
class CommandTable(object):
"""
Stores command tables and performs lookups.
Stores commands and performs lookups.
"""
ctable = None
@ -28,7 +28,7 @@ class CommandTable(object):
self.ctable = {}
def add_command(self, command_string, function, priv_tuple=None,
extra_vals=None, auto_help=False, staff_only=False):
extra_vals=None, auto_help=False, staff_help=False, state=None):
"""
Adds a command to the command table.
@ -41,7 +41,7 @@ class CommandTable(object):
auto_help (bool): If true, automatically creates/replaces a help topic with the
same name as the command_string, using the functions's __doc__ property
for help text.
staff_help (bool): Only relevant if help_auto is activated; It True, makes the
staff_help (bool): Only relevant if auto_help is activated; If True, makes the
help topic (and all eventual subtopics) only visible to staff.
Note: the auto_help system also supports limited markup. If you divide your __doc__
@ -57,7 +57,7 @@ class CommandTable(object):
#add automatic help text from the command's doc string
topicstr = command_string
entrytext = function.__doc__
add_help(topicstr, entrytext, staff_only=staff_only,
add_help(topicstr, entrytext, staff_only=staff_help,
force_create=True, auto_help=True)
def get_command_tuple(self, func_name):
@ -67,6 +67,7 @@ class CommandTable(object):
"""
return self.ctable.get(func_name, False)
"""
Command tables
"""