mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
Doc updates: +using-utils.md stub; update autogenerated references for protocols/inspircd, utils
This commit is contained in:
parent
bd85e1fa82
commit
3fb7b3ff1a
@ -18,6 +18,6 @@ PyLink is an a modular, plugin-based IRC PseudoService framework. It uses swappa
|
||||
|
||||
#### Future topics (not yet available)
|
||||
|
||||
- [Using PyLink's utils module](using-utils.md)
|
||||
- [PyLink hooks reference](hooks-reference.md)
|
||||
- [Writing tests for PyLink modules](writing-tests.md)
|
||||
- [Using PyLink's utils module](using-utils.md)
|
||||
|
@ -74,9 +74,11 @@ For InspIRCd, the only ENCAP command we handl
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_endburst"><strong>handle_endburst</strong></a>(self, numeric, command, args)</dt><dd><tt>ENDBURST handler; sends a hook with empty contents.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol. This passes most commands to<br>
|
||||
the various handle_ABCD() functions elsewhere in this module, but also<br>
|
||||
handles commands sent in the initial server linking phase.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol.<br>
|
||||
<br>
|
||||
This passes most commands to the various handle_ABCD() functions<br>
|
||||
elsewhere in this module, but also handles commands sent in the<br>
|
||||
initial server linking phase.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_fhost"><strong>handle_fhost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FHOST, used for denoting hostname changes.</tt></dd></dl>
|
||||
|
||||
@ -94,6 +96,8 @@ handles commands sent in the initial server l
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_opertype"><strong>handle_opertype</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming OPERTYPE, which is used to denote an oper up.<br>
|
||||
<br>
|
||||
This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal<br>
|
||||
@ -101,9 +105,11 @@ opertype of the client, and assumes setting u
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands, so we don't time out.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands. This is used to keep track of whether<br>
|
||||
the uplink is alive by the Irc() internals - a server that fails to reply<br>
|
||||
to our PINGs eventually times out and is disconnected.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands.<br>
|
||||
<br>
|
||||
This is used to keep track of whether the uplink is alive by the Irc()<br>
|
||||
internals - a server that fails to reply to our PINGs eventually<br>
|
||||
times out and is disconnected.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SERVER commands (introduction of servers).</tt></dd></dl>
|
||||
|
||||
@ -111,7 +117,7 @@ to our PINGs eventually times out and is 
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-inviteClient"><strong>inviteClient</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins an internal spawned client <client> to a channel.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins a PyLink client to a channel.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-killClient"><strong>killClient</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client.</tt></dd></dl>
|
||||
|
||||
@ -119,13 +125,13 @@ to our PINGs eventually times out and is 
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-knockClient"><strong>knockClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink client. <modes> should be<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink client. <modes> should be<br>
|
||||
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink server. <list of modes> should be<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink server. <list of modes> should be<br>
|
||||
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, text)</dt></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, target, text)</dt></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-pingServer"><strong>pingServer</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
||||
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
||||
@ -140,16 +146,19 @@ Example uses:<br>
|
||||
<a href="#Class-sjoinServer">sjoinServer</a>('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])<br>
|
||||
<a href="#Class-sjoinServer">sjoinServer</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None, manipulatable=False)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
||||
<br>
|
||||
Note: No nick collision / valid nickname checks are done here; it is<br>
|
||||
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server. desc (server description)<br>
|
||||
defaults to the one in the config. uplink defaults to the main PyLink<br>
|
||||
server, and sid (the server ID) is automatically generated if not<br>
|
||||
given.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-squitServer"><strong>squitServer</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a burst topic from a PyLink server. This is usally used on burst.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a topic change from a PyLink server. This is usually used on burst.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-updateClient"><strong>updateClient</strong></a>(self, numeric, field, text)</dt><dd><tt>Updates the ident, host, or realname of a PyLink client.</tt></dd></dl>
|
||||
|
||||
@ -161,9 +170,6 @@ Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6B
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes. For channel mode changes,<br>
|
||||
TMODE (TS6/charybdis) and FMODE (InspIRCd) are used instead.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
||||
@ -172,7 +178,7 @@ TMODE (TS6/charybdis) and FMODE (InspIRCd) are use
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUITs.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUIT commands.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
||||
|
||||
@ -191,9 +197,6 @@ TB (TS6/charybdis) and FTOPIC (InspIRCd) are used&
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-noticeClient"><strong>noticeClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
||||
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#Class-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
||||
of a line (usually the sender field).</tt></dd></dl>
|
||||
|
||||
@ -201,10 +204,15 @@ of a line (usually the sender field).</tt></dd></d
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-quitClient"><strong>quitClient</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-topicClient"><strong>topicClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
||||
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
@ -245,9 +253,11 @@ For InspIRCd, the only ENCAP command we handl
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_endburst"><strong>handle_endburst</strong></a>(self, numeric, command, args)</dt><dd><tt>ENDBURST handler; sends a hook with empty contents.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol. This passes most commands to<br>
|
||||
the various handle_ABCD() functions elsewhere in this module, but also<br>
|
||||
handles commands sent in the initial server linking phase.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol.<br>
|
||||
<br>
|
||||
This passes most commands to the various handle_ABCD() functions<br>
|
||||
elsewhere in this module, but also handles commands sent in the<br>
|
||||
initial server linking phase.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_fhost"><strong>handle_fhost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FHOST, used for denoting hostname changes.</tt></dd></dl>
|
||||
|
||||
@ -265,6 +275,8 @@ handles commands sent in the initial server l
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_opertype"><strong>handle_opertype</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming OPERTYPE, which is used to denote an oper up.<br>
|
||||
<br>
|
||||
This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal<br>
|
||||
@ -272,9 +284,11 @@ opertype of the client, and assumes setting u
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands, so we don't time out.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands. This is used to keep track of whether<br>
|
||||
the uplink is alive by the Irc() internals - a server that fails to reply<br>
|
||||
to our PINGs eventually times out and is disconnected.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands.<br>
|
||||
<br>
|
||||
This is used to keep track of whether the uplink is alive by the Irc()<br>
|
||||
internals - a server that fails to reply to our PINGs eventually<br>
|
||||
times out and is disconnected.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SERVER commands (introduction of servers).</tt></dd></dl>
|
||||
|
||||
@ -282,7 +296,7 @@ to our PINGs eventually times out and is 
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-inviteClient"><strong>inviteClient</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins an internal spawned client <client> to a channel.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins a PyLink client to a channel.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-killClient"><strong>killClient</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client.</tt></dd></dl>
|
||||
|
||||
@ -290,13 +304,13 @@ to our PINGs eventually times out and is 
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-knockClient"><strong>knockClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink client. <modes> should be<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink client. <modes> should be<br>
|
||||
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink server. <list of modes> should be<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink server. <list of modes> should be<br>
|
||||
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, text)</dt></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, target, text)</dt></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-pingServer"><strong>pingServer</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
||||
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
||||
@ -311,16 +325,19 @@ Example uses:<br>
|
||||
<a href="#InspIRCdProtocol-sjoinServer">sjoinServer</a>('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])<br>
|
||||
<a href="#InspIRCdProtocol-sjoinServer">sjoinServer</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None, manipulatable=False)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
||||
<br>
|
||||
Note: No nick collision / valid nickname checks are done here; it is<br>
|
||||
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server. desc (server description)<br>
|
||||
defaults to the one in the config. uplink defaults to the main PyLink<br>
|
||||
server, and sid (the server ID) is automatically generated if not<br>
|
||||
given.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-squitServer"><strong>squitServer</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a burst topic from a PyLink server. This is usally used on burst.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a topic change from a PyLink server. This is usually used on burst.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-updateClient"><strong>updateClient</strong></a>(self, numeric, field, text)</dt><dd><tt>Updates the ident, host, or realname of a PyLink client.</tt></dd></dl>
|
||||
|
||||
@ -332,9 +349,6 @@ Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6B
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes. For channel mode changes,<br>
|
||||
TMODE (TS6/charybdis) and FMODE (InspIRCd) are used instead.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
||||
@ -343,7 +357,7 @@ TMODE (TS6/charybdis) and FMODE (InspIRCd) are use
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUITs.</tt></dd></dl>
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUIT commands.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
||||
|
||||
@ -362,9 +376,6 @@ TB (TS6/charybdis) and FTOPIC (InspIRCd) are used&
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-noticeClient"><strong>noticeClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
||||
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#InspIRCdProtocol-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
||||
of a line (usually the sender field).</tt></dd></dl>
|
||||
|
||||
@ -372,10 +383,15 @@ of a line (usually the sender field).</tt></dd></d
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-quitClient"><strong>quitClient</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-topicClient"><strong>topicClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
||||
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
||||
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
@ -391,7 +407,6 @@ Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol
|
||||
<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>conf</strong> = {'bot': {'loglevel': 'CRITICAL', 'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'servers': defaultdict(<function <lambda> at 0x7f0dbb516c80>, {})}<br>
|
||||
<strong>curdir</strong> = 'protocols'<br>
|
||||
<td width="100%"><strong>curdir</strong> = 'protocols'<br>
|
||||
<strong>log</strong> = <logging.RootLogger object></td></tr></table>
|
||||
</body></html>
|
1
docs/technical/using-utils.md
Normal file
1
docs/technical/using-utils.md
Normal file
@ -0,0 +1 @@
|
||||
This page is under construction: see [utils.html ](utils.html) for autogenerated documentation for the utils module.
|
233
docs/technical/utils.html
Normal file
233
docs/technical/utils.html
Normal file
@ -0,0 +1,233 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module utils</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</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:/home/gl/pylink/utils.py">/home/gl/pylink/utils.py</a></font></td></tr></table>
|
||||
<p></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" 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="imp.html">imp</a><br>
|
||||
<a href="inspect.html">inspect</a><br>
|
||||
</td><td width="25%" valign=top><a href="re.html">re</a><br>
|
||||
<a href="string.html">string</a><br>
|
||||
</td><td width="25%" valign=top><a href="world.html">world</a><br>
|
||||
</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="#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="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="utils.html#NotAuthenticatedError">NotAuthenticatedError</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="utils.html#TS6SIDGenerator">TS6SIDGenerator</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="utils.html#TS6UIDGenerator">TS6UIDGenerator</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="NotAuthenticatedError">class <strong>NotAuthenticatedError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt># This is separate from classes.py to prevent import loops.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="utils.html#NotAuthenticatedError">NotAuthenticatedError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
|
||||
<dl><dt><a name="NotAuthenticatedError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="NotAuthenticatedError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotAuthenticatedError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt><a href="builtins.html#Exception">Exception</a>.<a href="#NotAuthenticatedError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table> <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="TS6SIDGenerator">class <strong>TS6SIDGenerator</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>TS6 SID Generator. <query> is a 3 character string with any combination of<br>
|
||||
uppercase letters, digits, and #'s. it must contain at least one #,<br>
|
||||
which are used by the generator as a wildcard. On every <a href="#TS6SIDGenerator-next_sid">next_sid</a>() call,<br>
|
||||
the first available wildcard character (from the right) will be<br>
|
||||
incremented to generate the next SID.<br>
|
||||
<br>
|
||||
When there are no more available SIDs left (SIDs are not reused, only<br>
|
||||
incremented), RuntimeError is raised.<br>
|
||||
<br>
|
||||
Example queries:<br>
|
||||
"1#A" would give: 10A, 11A, 12A ... 19A, 1AA, 1BA ... 1ZA (36 total results)<br>
|
||||
"#BQ" would give: 0BQ, 1BQ, 2BQ ... 9BQ (10 total results)<br>
|
||||
"6##" would give: 600, 601, 602, ... 60Y, 60Z, 610, 611, ... 6ZZ (1296 total results)<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="TS6SIDGenerator-__init__"><strong>__init__</strong></a>(self, irc)</dt></dl>
|
||||
|
||||
<dl><dt><a name="TS6SIDGenerator-increment"><strong>increment</strong></a>(self, pos=2)</dt></dl>
|
||||
|
||||
<dl><dt><a name="TS6SIDGenerator-next_sid"><strong>next_sid</strong></a>(self)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
</td></tr></table> <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="TS6UIDGenerator">class <strong>TS6UIDGenerator</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>TS6 UID Generator module, adapted from InspIRCd source<br>
|
||||
https://github.com/inspircd/inspircd/blob/f449c6b296ab/src/server.cpp#L85-L156<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="TS6UIDGenerator-__init__"><strong>__init__</strong></a>(self, sid)</dt></dl>
|
||||
|
||||
<dl><dt><a name="TS6UIDGenerator-increment"><strong>increment</strong></a>(self, pos=5)</dt></dl>
|
||||
|
||||
<dl><dt><a name="TS6UIDGenerator-next_uid"><strong>next_uid</strong></a>(self)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</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="-add_cmd"><strong>add_cmd</strong></a>(func, name=None)</dt></dl>
|
||||
<dl><dt><a name="-add_hook"><strong>add_hook</strong></a>(func, command)</dt><dd><tt>Add a hook <func> for command <command>.</tt></dd></dl>
|
||||
<dl><dt><a name="-applyModes"><strong>applyModes</strong></a>(irc, target, changedmodes)</dt><dd><tt>Takes a list of parsed IRC modes, and applies them on the given target.<br>
|
||||
<br>
|
||||
The target can be either a channel or a user; this is handled automatically.</tt></dd></dl>
|
||||
<dl><dt><a name="-checkAuthenticated"><strong>checkAuthenticated</strong></a>(irc, uid, allowAuthed=True, allowOper=True)</dt><dd><tt>Checks whetherthe given user has operator status on PyLink, raising<br>
|
||||
<a href="#NotAuthenticatedError">NotAuthenticatedError</a> and logging the access denial if not.</tt></dd></dl>
|
||||
<dl><dt><a name="-clientToServer"><strong>clientToServer</strong></a>(irc, numeric)</dt><dd><tt>Finds the SID of the server a user is on.</tt></dd></dl>
|
||||
<dl><dt><a name="-getHostmask"><strong>getHostmask</strong></a>(irc, user)</dt><dd><tt>Gets the hostmask of the given user, if present.</tt></dd></dl>
|
||||
<dl><dt><a name="-getProtoModule"><strong>getProtoModule</strong></a>(protoname)</dt><dd><tt>Imports and returns the protocol module requested.</tt></dd></dl>
|
||||
<dl><dt><a name="-isChannel"><strong>isChannel</strong></a>(s)</dt><dd><tt>Checks whether the string given is a valid channel name.</tt></dd></dl>
|
||||
<dl><dt><a name="-isHostmask"><strong>isHostmask</strong></a>(text)</dt><dd><tt>Returns whether the given text is a valid hostmask.</tt></dd></dl>
|
||||
<dl><dt><a name="-isInternalClient"><strong>isInternalClient</strong></a>(irc, numeric)</dt><dd><tt>Checks whether the given numeric is a PyLink Client,<br>
|
||||
returning the SID of the server it's on if so.</tt></dd></dl>
|
||||
<dl><dt><a name="-isInternalServer"><strong>isInternalServer</strong></a>(irc, sid)</dt><dd><tt>Returns whether the given SID is an internal PyLink server.</tt></dd></dl>
|
||||
<dl><dt><a name="-isManipulatableClient"><strong>isManipulatableClient</strong></a>(irc, uid)</dt><dd><tt>Returns whether the given user is marked as an internal, manipulatable<br>
|
||||
client. Usually, automatically spawned services clients should have this<br>
|
||||
set True to prevent interactions with opers (like mode changes) from<br>
|
||||
causing desyncs.</tt></dd></dl>
|
||||
<dl><dt><a name="-isNick"><strong>isNick</strong></a>(s, nicklen=None)</dt><dd><tt>Checks whether the string given is a valid nick.</tt></dd></dl>
|
||||
<dl><dt><a name="-isOper"><strong>isOper</strong></a>(irc, uid, allowAuthed=True, allowOper=True)</dt><dd><tt>Returns whether the given user has operator status on PyLink. This can be achieved<br>
|
||||
by either identifying to PyLink as admin (if allowAuthed is True),<br>
|
||||
or having user mode +o set (if allowOper is True). At least one of<br>
|
||||
allowAuthed or allowOper must be True for this to give any meaningful<br>
|
||||
results.</tt></dd></dl>
|
||||
<dl><dt><a name="-isServerName"><strong>isServerName</strong></a>(s)</dt><dd><tt>Checks whether the string given is a server name.</tt></dd></dl>
|
||||
<dl><dt><a name="-joinModes"><strong>joinModes</strong></a>(modes)</dt><dd><tt>Takes a list of (mode, arg) tuples in <a href="#-parseModes">parseModes</a>() format, and<br>
|
||||
joins them into a string.<br>
|
||||
<br>
|
||||
See testJoinModes in tests/test_utils.py for some examples.</tt></dd></dl>
|
||||
<dl><dt><a name="-loadModuleFromFolder"><strong>loadModuleFromFolder</strong></a>(name, folder)</dt><dd><tt>Attempts an import of name from a specific folder, returning the resulting module.</tt></dd></dl>
|
||||
<dl><dt><a name="-nickToUid"><strong>nickToUid</strong></a>(irc, nick)</dt><dd><tt>Returns the UID of a user named nick, if present.</tt></dd></dl>
|
||||
<dl><dt><a name="-parseModes"><strong>parseModes</strong></a>(irc, target, args)</dt><dd><tt>Parses a modestring list into a list of (mode, argument) tuples.<br>
|
||||
['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]</tt></dd></dl>
|
||||
<dl><dt><a name="-reverseModes"><strong>reverseModes</strong></a>(irc, target, modes, oldobj=None)</dt><dd><tt>Reverses/Inverts the mode string or mode list given.<br>
|
||||
<br>
|
||||
Optionally, an oldobj argument can be given to look at an earlier state of<br>
|
||||
a channel/user <a href="builtins.html#object">object</a>, e.g. for checking the op status of a mode setter<br>
|
||||
before their modes are processed and added to the channel state.<br>
|
||||
<br>
|
||||
This function allows both mode strings or mode lists. Example uses:<br>
|
||||
"+mi-lk test => "-mi+lk test"<br>
|
||||
"mi-k test => "-mi+k test"<br>
|
||||
[('+m', None), ('+r', None), ('+l', '3'), ('-o', 'person')<br>
|
||||
=> {('-m', None), ('-r', None), ('-l', None), ('+o', 'person')})<br>
|
||||
{('s', None), ('+o', 'whoever') => {('-s', None), ('-o', 'whoever')})</tt></dd></dl>
|
||||
<dl><dt><a name="-toLower"><strong>toLower</strong></a>(irc, text)</dt><dd><tt>Returns a lowercase representation of text based on the IRC <a href="builtins.html#object">object</a>'s<br>
|
||||
casemapping (rfc1459 or ascii).</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>hostmaskRe</strong> = re.compile('^\\S+!\\S+@\\S+$')<br>
|
||||
<strong>log</strong> = <logging.RootLogger object></td></tr></table>
|
||||
</body></html>
|
Loading…
Reference in New Issue
Block a user