<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: mudsock</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>mudsock</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table> <p><tt>Contains the Python wrapper for sockets, and utilities for listing<br> currently connected sockets.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="mudsock.html#Mudsock">Mudsock</a> </font></dt></dl> </dd> </dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Mudsock">class <strong>Mudsock</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Python Socket <a href="__builtin__.html#object">object</a><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Mudsock-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__cmp__">__cmp__</a>(y) <==> cmp(x,y)</tt></dd></dl> <dl><dt><a name="Mudsock-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Mudsock-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> <dl><dt><a name="Mudsock-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias for mudsock.<a href="#Mudsock">Mudsock</a>.getAuxiliary</tt></dd></dl> <dl><dt><a name="Mudsock-bust_prompt"><strong>bust_prompt</strong></a>(...)</dt><dd><tt><a href="#Mudsock-bust_prompt">bust_prompt</a>()<br> <br> Busts the socket's prompt so it will be displayed next pulse.</tt></dd></dl> <dl><dt><a name="Mudsock-close"><strong>close</strong></a>(...)</dt><dd><tt><a href="#Mudsock-close">close</a>()<br> <br> Closes the socket's connection.</tt></dd></dl> <dl><dt><a name="Mudsock-edit_text"><strong>edit_text</strong></a>(...)</dt><dd><tt><a href="#Mudsock-edit_text">edit_text</a>(dflt_value, on_complete, mode='text')<br> <br> Enter the text editor, and set its default value. When the text editor<br> is edited, call on_complete. This function should take two arguments:<br> the socket doing the editing, and the output of the editor. Mode can<br> be 'text' or 'script'.</tt></dd></dl> <dl><dt><a name="Mudsock-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Mudsock-getAuxiliary">getAuxiliary</a>(name)<br> <br> Returns socket's auxiliary data of the specified name.</tt></dd></dl> <dl><dt><a name="Mudsock-pop_ih"><strong>pop_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-pop_ih">pop_ih</a>()<br> <br> Pops the socket's current input handler from its input handler stack.</tt></dd></dl> <dl><dt><a name="Mudsock-push_ih"><strong>push_ih</strong></a>(...)</dt><dd><tt><a href="#Mudsock-push_ih">push_ih</a>(handler_func, prompt_func, state=None)<br> <br> Pushes a new input handler and prompt pair onto the socket's input<br> handler stack. Optionally, a (String) state value can be supplied.<br> Input handlers take two arguments: the socket and a string command.<br> Prompts take one argument: the socket. They should send the relevant<br> text for the prompt to the socket.</tt></dd></dl> <dl><dt><a name="Mudsock-replace_ih"><strong>replace_ih</strong></a>(...)</dt><dd><tt>repalce_ih(handler_func, prompt_func, state=None)<br> <br> Calls pop_ih, followed by push_ih.</tt></dd></dl> <dl><dt><a name="Mudsock-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send">send</a>(mssg, dict = None, newline = True)<br> <br> Sends message to the socket. Messages can have scripts embedded in<br> them, using [ and ]. If so, a variable dictionary must be provided. By<br> default, 'me' references the socket being sent the message.</tt></dd></dl> <dl><dt><a name="Mudsock-send_raw"><strong>send_raw</strong></a>(...)</dt><dd><tt><a href="#Mudsock-send_raw">send_raw</a>(mssg)<br> <br> Sends text to the socket. No appended newline.</tt></dd></dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>account</strong></dt> <dd><tt>The account currently attached to the socket, or None. Immutable.<br> see mudsys.attach_account_socket for connecting sockets and accounts.</tt></dd> </dl> <dl><dt><strong>can_use</strong></dt> <dd><tt>True or False if the socket is ready for use. Socket becomes available<br> after its dns addresss resolves. Immutable.</tt></dd> </dl> <dl><dt><strong>ch</strong></dt> <dd><tt>Alias for mudsock.Mudsock.character.</tt></dd> </dl> <dl><dt><strong>char</strong></dt> <dd><tt>Alias for mudsock.Mudsock.character</tt></dd> </dl> <dl><dt><strong>character</strong></dt> <dd><tt>The character currently attached to the socket, on None. Immutable.<br> see mudsys.attach_char_socket for connecting characters to account.</tt></dd> </dl> <dl><dt><strong>has_input</strong></dt> <dd><tt>True or False if the socket has any input pending. Immutable.</tt></dd> </dl> <dl><dt><strong>hostname</strong></dt> <dd><tt>The dns address that the socket is connected from. Immutable.</tt></dd> </dl> <dl><dt><strong>idle_time</strong></dt> <dd><tt>How long (in seconds) the socket's input handler has been idle for. Immutable.</tt></dd> </dl> <dl><dt><strong>outbound_text</strong></dt> <dd><tt>The socket's outbound text.</tt></dd> </dl> <dl><dt><strong>state</strong></dt> <dd><tt>The state that the socket is in. Immutable. For more on states see<br> mudsock.Mudsock.push_ih</tt></dd> </dl> <dl><dt><strong>uid</strong></dt> <dd><tt>The socket's uid. Immutable.</tt></dd> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0x6f980><dd><tt>T.<a href="#Mudsock-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> </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="-socket_list"><strong>socket_list</strong></a>(...)</dt><dd><tt><a href="#-socket_list">socket_list</a>()<br> <br> Returns a list of all sockets currently connected.</tt></dd></dl> </td></tr></table> </body></html>