polc.main
index
/mud/nakedmud-mod/lib/pymodules/polc/main.py

################################################################################
#
# Four Worlds
# Copyright (c) 2009-????
#
# Package: polc
#    File: main.py
#
# The automatic Python OLC system, capable of generating an online content editor
# for a given Python class or dict by using dictionaries to discover properties.
#
# OLC Initialization and Rendering 
#
# Author: Stendec
#
################################################################################

 
Modules
       
auxiliary
copy
mudsys
olc
polc.parsers
polc.renderers
storage

 
Functions
       
do_olc(sock, object, saver=None, key=None, options=None, autosave=False)
Initialize the Python OLC system for the given object.
fancy_key(key)
Attempt to make a key name fancy. If it's in an array of default names, return the
corresponding fancy name. Otherwise, convert underscores to spaces and make it
title case.
get_name(object)
Attempts to get a name from an object for display in the menu.
notepad_end(sock, text)
Finish the notepad system.
notepad_enter(sock, data, key)
Enter the notepad system. Store a copy of the working copy of the aux data
in the copy of the aux data attached to the socket. Confusing, no?
olc_enter(sock, data, key)
Open an editor for a subobject with autosave set to True to prevent
showing the user a 'Save?' question when they back out.
polc_choice_chooser(sock, data, opt)
polc_choice_list(sock, data, key)
Display a submenu of avaliable choices.
polc_choice_menu(sock, data)
polc_choice_parser(sock, data, opt, val)
polc_chooser(sock, data, opt)
Determine if the provided option was valid.
polc_menu(sock, data)
Display the menu for the provided object.
polc_parser(sock, data, opt, val)
Parse the user's input and validate it, then store it in the object.
polc_saver(data)
Return the saved data to the saver function, if one exists.

 
Data
        MENU_CHOICE_INVALID = -1
MENU_NOCHOICE = 0
StringTypes = (<type 'str'>, <type 'unicode'>)
fancy_keys = {'desc': 'Description', 'edesc': 'Extra Descriptions', 'mdesc': 'Room Description for Multiple Occurences', 'mname': 'Name for Multiple Occurences', 'rdesc': 'Room Description'}
menukeys = '1234567890ABCDEFGHIJKLMNOPRSTUVWXYZ'