<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: polc.main</title> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="polc.html"><font color="#ffffff">polc</font></a>.main</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/mud/nakedmud-mod/lib/pymodules/polc/main.py">/mud/nakedmud-mod/lib/pymodules/polc/main.py</a></font></td></tr></table> <p><tt>################################################################################<br> #<br> # Four Worlds<br> # Copyright (c) 2009-????<br> #<br> # Package: polc<br> # File: main.py<br> #<br> # The automatic Python OLC system, capable of generating an online content editor<br> # for a given Python class or dict by using dictionaries to discover properties.<br> #<br> # OLC Initialization and Rendering <br> #<br> # Author: Stendec<br> #<br> ################################################################################</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom> <br> <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="auxiliary.html">auxiliary</a><br> <a href="copy.html">copy</a><br> </td><td width="25%" valign=top><a href="mudsys.html">mudsys</a><br> <a href="olc.html">olc</a><br> </td><td width="25%" valign=top><a href="polc.parsers.html">polc.parsers</a><br> <a href="polc.renderers.html">polc.renderers</a><br> </td><td width="25%" valign=top><a href="storage.html">storage</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-do_olc"><strong>do_olc</strong></a>(sock, object, saver<font color="#909090">=None</font>, key<font color="#909090">=None</font>, options<font color="#909090">=None</font>, autosave<font color="#909090">=False</font>)</dt><dd><tt>Initialize the Python OLC system for the given object.</tt></dd></dl> <dl><dt><a name="-fancy_key"><strong>fancy_key</strong></a>(key)</dt><dd><tt>Attempt to make a key name fancy. If it's in an array of default names, return the<br> corresponding fancy name. Otherwise, convert underscores to spaces and make it<br> title case.</tt></dd></dl> <dl><dt><a name="-get_name"><strong>get_name</strong></a>(object)</dt><dd><tt>Attempts to get a name from an object for display in the menu.</tt></dd></dl> <dl><dt><a name="-notepad_end"><strong>notepad_end</strong></a>(sock, text)</dt><dd><tt>Finish the notepad system.</tt></dd></dl> <dl><dt><a name="-notepad_enter"><strong>notepad_enter</strong></a>(sock, data, key)</dt><dd><tt>Enter the notepad system. Store a copy of the working copy of the aux data<br> in the copy of the aux data attached to the socket. Confusing, no?</tt></dd></dl> <dl><dt><a name="-olc_enter"><strong>olc_enter</strong></a>(sock, data, key)</dt><dd><tt>Open an editor for a subobject with autosave set to True to prevent<br> showing the user a 'Save?' question when they back out.</tt></dd></dl> <dl><dt><a name="-polc_choice_chooser"><strong>polc_choice_chooser</strong></a>(sock, data, opt)</dt></dl> <dl><dt><a name="-polc_choice_list"><strong>polc_choice_list</strong></a>(sock, data, key)</dt><dd><tt>Display a submenu of avaliable choices.</tt></dd></dl> <dl><dt><a name="-polc_choice_menu"><strong>polc_choice_menu</strong></a>(sock, data)</dt></dl> <dl><dt><a name="-polc_choice_parser"><strong>polc_choice_parser</strong></a>(sock, data, opt, val)</dt></dl> <dl><dt><a name="-polc_chooser"><strong>polc_chooser</strong></a>(sock, data, opt)</dt><dd><tt>Determine if the provided option was valid.</tt></dd></dl> <dl><dt><a name="-polc_menu"><strong>polc_menu</strong></a>(sock, data)</dt><dd><tt>Display the menu for the provided object.</tt></dd></dl> <dl><dt><a name="-polc_parser"><strong>polc_parser</strong></a>(sock, data, opt, val)</dt><dd><tt>Parse the user's input and validate it, then store it in the object.</tt></dd></dl> <dl><dt><a name="-polc_saver"><strong>polc_saver</strong></a>(data)</dt><dd><tt>Return the saved data to the saver function, if one exists.</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> <td width="100%"><strong>MENU_CHOICE_INVALID</strong> = -1<br> <strong>MENU_NOCHOICE</strong> = 0<br> <strong>StringTypes</strong> = (<type 'str'>, <type 'unicode'>)<br> <strong>fancy_keys</strong> = {'desc': 'Description', 'edesc': 'Extra Descriptions', 'mdesc': 'Room Description for Multiple Occurences', 'mname': 'Name for Multiple Occurences', 'rdesc': 'Room Description'}<br> <strong>menukeys</strong> = '1234567890ABCDEFGHIJKLMNOPRSTUVWXYZ'</td></tr></table> </body></html>