<!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-bell"><strong>bell</strong></a> = __bell(s)</dt><dd><tt>Set a flashing marker in the title to let someone know the MUD wants their attention.</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-sendMSDP"><strong>sendMSDP</strong></a> = __sendMSDP(s, key, val<font color="#909090">=None</font>)</dt><dd><tt>Send a new MSDP variable to the client if MSDP is enabled. Store the<br> variable to be sure not to send repeated information.</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> <dl><dt><a name="Mudsock-trans_raw"><strong>trans_raw</strong></a>(...)</dt><dd><tt><a href="#Mudsock-trans_raw">trans_raw</a>(mssg)<br> <br> Sends text to the socket. No appended newline, and no checking for the prompt.</tt></dd></dl> <hr> Properties defined here:<br> <dl><dt><strong>MSDP</strong></dt> <dd><tt>True if MSDP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MSDP. Delete this to resume automatic detection of MSDP support.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getmsdp(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __setmsdp(s, v)</dt></dl> </dd> <dd><dl><dt><a name="-<em>delete</em>"><strong><em>delete</em></strong></a> = __delmsdp(s)</dt></dl> </dd> </dl> <dl><dt><strong>MSP</strong></dt> <dd><tt>True if MSP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MSP. Delete this to resume automatic detection of MSP support.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getmsp(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __setmsp(s, v)</dt></dl> </dd> <dd><dl><dt><a name="-<em>delete</em>"><strong><em>delete</em></strong></a> = __delmsp(s)</dt></dl> </dd> </dl> <dl><dt><strong>MXP</strong></dt> <dd><tt>True if MXP output to the client is enabled, else false. Setting a boolean to this property will forcibly enable or disable MXP. Delete this to resume automatic detection of MXP support.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getmxp(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __setmxp(s, v)</dt></dl> </dd> <dd><dl><dt><a name="-<em>delete</em>"><strong><em>delete</em></strong></a> = __delmxp(s)</dt></dl> </dd> </dl> <dl><dt><strong>c256</strong></dt> <dd><tt>Gets or sets the state of 256-colors mode on the socket. Set to True to enable, False to disable, or delete to use the automatically detect state based on client identification.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getc256(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __setc256(s, v)</dt></dl> </dd> <dd><dl><dt><a name="-<em>delete</em>"><strong><em>delete</em></strong></a> = __delc256(s)</dt></dl> </dd> </dl> <dl><dt><strong>client</strong></dt> <dd><tt>The client software, as given by TELOPT_TTYPE.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getclient(s)</dt></dl> </dd> </dl> <dl><dt><strong>endofrecord</strong></dt> <dd><tt>True if the client has requested END-OF-RECORD codes, else False. See <a href="http://www.rfc-editor.org/rfc/rfc885.txt">RFC 885</a> for more on END-OF-RECORD.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __geteor(s)</dt></dl> </dd> </dl> <dl><dt><strong>n256</strong></dt> <dd><tt>The automatically detected state of 256-colors mode, based on client identification.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getn256(s)</dt></dl> </dd> </dl> <dl><dt><strong>nMSDP</strong></dt> <dd><tt>True if the client has requested MSDP, else False.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getnmsp(s)</dt></dl> </dd> </dl> <dl><dt><strong>nMSP</strong></dt> <dd><tt>True if the client has requested MSP, else False.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getnmsp(s)</dt></dl> </dd> </dl> <dl><dt><strong>nMXP</strong></dt> <dd><tt>True if the client has requested MXP, else False.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getnmxp(s)</dt><dd><tt># Read Only Properties / Methods</tt></dd></dl> </dd> </dl> <dl><dt><strong>nTitle</strong></dt> <dd><tt>The automatically detected state of window title support, based on client identification.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __getntitle(s)</dt></dl> </dd> </dl> <dl><dt><strong>telopt</strong></dt> <dd><tt>The auxiliary data of the advanced_telopt module.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __gettelopt(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __settelopt(s, data)</dt></dl> </dd> </dl> <dl><dt><strong>title</strong></dt> <dd><tt>True if title string output to the client is enabled, else false. Setting a string to this property will change the window title message. Setting a boolean to this property will forcibly enable or disable title output. Delete this to determine title support based on the report client.</tt></dd> <dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = __gettitle(s)</dt></dl> </dd> <dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = __settitle(s, v)</dt></dl> </dd> <dd><dl><dt><a name="-<em>delete</em>"><strong><em>delete</em></strong></a> = __deltitle(s)</dt></dl> </dd> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><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> <dl><dt><strong>account</strong> = <attribute 'account' of 'mudsock.Mudsock' objects><dd><tt>The account currently attached to the socket, or None. Immutable.<br> see mudsys.attach_account_socket for connecting sockets and accounts.</tt></dl> <dl><dt><strong>can_use</strong> = <attribute 'can_use' of 'mudsock.Mudsock' objects><dd><tt>True or False if the socket is ready for use. Socket becomes available<br> after its dns addresss resolves. Immutable.</tt></dl> <dl><dt><strong>ch</strong> = <attribute 'ch' of 'mudsock.Mudsock' objects><dd><tt>Alias for mudsock.<a href="#Mudsock">Mudsock</a>.character.</tt></dl> <dl><dt><strong>char</strong> = <attribute 'char' of 'mudsock.Mudsock' objects><dd><tt>Alias for mudsock.<a href="#Mudsock">Mudsock</a>.character</tt></dl> <dl><dt><strong>character</strong> = <attribute 'character' of 'mudsock.Mudsock' objects><dd><tt>The character currently attached to the socket, on None. Immutable.<br> see mudsys.attach_char_socket for connecting characters to account.</tt></dl> <dl><dt><strong>cols</strong> = <attribute 'cols' of 'mudsock.Mudsock' objects><dd><tt>The width of the client's output in columns.</tt></dl> <dl><dt><strong>has_input</strong> = <attribute 'has_input' of 'mudsock.Mudsock' objects><dd><tt>True or False if the socket has any input pending. Immutable.</tt></dl> <dl><dt><strong>hostname</strong> = <attribute 'hostname' of 'mudsock.Mudsock' objects><dd><tt>The dns address that the socket is connected from. Immutable.</tt></dl> <dl><dt><strong>idle_time</strong> = <attribute 'idle_time' of 'mudsock.Mudsock' objects><dd><tt>How long (in seconds) the socket's input handler has been idle for. Immutable.</tt></dl> <dl><dt><strong>outbound_text</strong> = <attribute 'outbound_text' of 'mudsock.Mudsock' objects><dd><tt>The socket's outbound text.</tt></dl> <dl><dt><strong>rows</strong> = <attribute 'rows' of 'mudsock.Mudsock' objects><dd><tt>The height of the client's output in rows.</tt></dl> <dl><dt><strong>state</strong> = <attribute 'state' of 'mudsock.Mudsock' objects><dd><tt>The state that the socket is in. Immutable. For more on states see<br> mudsock.<a href="#Mudsock">Mudsock</a>.push_ih</tt></dl> <dl><dt><strong>uid</strong> = <attribute 'uid' of 'mudsock.Mudsock' objects><dd><tt>The socket's uid. Immutable.</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>