123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: utils</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>utils</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/hollis/Desktop/nakedmud/lib/pymodules/utils.py">/Users/hollis/Desktop/nakedmud/lib/pymodules/utils.py</a></font></td></tr></table>
- <p><tt>utils.py<br>
- <br>
- Various utility functions used by other Python modules.</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="mud.html">mud</a><br>
- </td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></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="-aan"><strong>aan</strong></a>(word)</dt><dd><tt>return "a" or "an", depending on the word.</tt></dd></dl>
- <dl><dt><a name="-build_show_list"><strong>build_show_list</strong></a>(ch, list, s_func, m_func<font color="#909090">=None</font>, joiner<font color="#909090">='<font color="#c040c0">\r\n</font>'</font>, and_end<font color="#909090">=False</font>)</dt><dd><tt>builds a list of things to show a character. s_func is the description if<br>
- there is only a single item of the type. m_func is the description if<br>
- there are multiple occurences of the thing in the list</tt></dd></dl>
- <dl><dt><a name="-chk_conscious"><strong>chk_conscious</strong></a>(ch, cmd)</dt></dl>
- <dl><dt><a name="-find_all_chars"><strong>find_all_chars</strong></a>(looker, list, name, proto<font color="#909090">=None</font>, must_see<font color="#909090">=True</font>)</dt><dd><tt>returns a list of all the chars that match the supplied constraints</tt></dd></dl>
- <dl><dt><a name="-find_all_objs"><strong>find_all_objs</strong></a>(looker, list, name, proto<font color="#909090">=None</font>, must_see<font color="#909090">=True</font>)</dt><dd><tt>returns a list of all the objects that match the supplied constraints</tt></dd></dl>
- <dl><dt><a name="-find_char"><strong>find_char</strong></a>(looker, list, num, name, proto<font color="#909090">=None</font>, must_see<font color="#909090">=True</font>)</dt><dd><tt>returns the numth char to match the supplied constraints</tt></dd></dl>
- <dl><dt><a name="-find_obj"><strong>find_obj</strong></a>(looker, list, num, name, proto<font color="#909090">=None</font>, must_see<font color="#909090">=True</font>)</dt><dd><tt>returns the numth object to match the supplied constraints</tt></dd></dl>
- <dl><dt><a name="-get_count"><strong>get_count</strong></a>(str)</dt><dd><tt>separates a name and a count, and returns the two</tt></dd></dl>
- <dl><dt><a name="-has_proto"><strong>has_proto</strong></a>(ch, proto)</dt><dd><tt>returns whether or not the character has on his or her person an object<br>
- that inherits from the given prototype</tt></dd></dl>
- <dl><dt><a name="-is_keyword"><strong>is_keyword</strong></a>(kw, word, abbrev_ok<font color="#909090">=False</font>)</dt><dd><tt>returns whether or not the word (or list of words) is a keyword</tt></dd></dl>
- <dl><dt><a name="-is_one_keyword"><strong>is_one_keyword</strong></a>(kw, word, abbrev_ok<font color="#909090">=False</font>)</dt><dd><tt>returns whether or not the single word is a keyword in the list</tt></dd></dl>
- <dl><dt><a name="-olc_display_table"><strong>olc_display_table</strong></a>(sock, list, num_cols, disp<font color="#909090">=<function <lambda> at 0x765e70></font>)</dt><dd><tt>used by OLC functions to display a list of options in a table form.<br>
- Also displays each option's position number and colorizes everything.</tt></dd></dl>
- <dl><dt><a name="-parse_keywords"><strong>parse_keywords</strong></a>(kw)</dt><dd><tt>turns a comma-separated list of strings to a list of keywords</tt></dd></dl>
- <dl><dt><a name="-show_list"><strong>show_list</strong></a>(ch, list, s_func, m_func<font color="#909090">=None</font>)</dt><dd><tt>shows a list of things to the character. s_func is the description if<br>
- there is only a single item of the type. m_func is the description if<br>
- there are multiple occurences of the thing in the list</tt></dd></dl>
- </td></tr></table>
- </body></html>
|