diff --git a/docs/technical/autogen/classes.html b/docs/technical/autogen/classes.html index e639b74..5e14a91 100644 --- a/docs/technical/autogen/classes.html +++ b/docs/technical/autogen/classes.html @@ -23,15 +23,17 @@ Here be dragons.

       
hashlib
+inspect
logging
-os
-
socket
+
os
+socket
ssl
+
structures
sys
-
threading
-time
+threading
+
time
utils
-
world
+world

@@ -43,7 +45,8 @@ Here be dragons.

builtins.Exception(builtins.BaseException)
-
ProtocolError +
NotAuthenticatedError +
ProtocolError
builtins.object @@ -83,12 +86,11 @@ Here be dragons.


Methods defined here:
-
connect(self)
Runs the connect loop for the IRC object. This is usually called by
-__init__ in a separate thread to allow multiple concurrent connections.
+
connect(self)
run(self, data)
Queues a message to the fake IRC server.
-
send(self, data)
Sends raw text to the uplink server.
+
send(self, data)
takeCommands(self, msgs)
Returns a list of commands parsed from the output of takeMsgs().
@@ -104,15 +106,27 @@ Methods inherited from Irc:
(a string), the name of the protocol module to use for this connection,
and a configuration object. -
__repr__(self)
Return repr(self).
+
__repr__(self)
+ +
applyModes(self, target, changedmodes)
Takes a list of parsed IRC modes, and applies them on the given target.

+The target can be either a channel or a user; this is handled automatically.
callCommand(self, source, text)
Calls a PyLink bot command. source is the caller's UID, and text is the
full, unparsed text of the message.
callHooks(self, hook_args)
Calls a hook function with the given hook args.
+
checkAuthenticated(self, uid, allowAuthed=True, allowOper=True)
Checks whether the given user has operator status on PyLink, raising
+NotAuthenticatedError and logging the access denial if not.
+
disconnect(self)
Handle disconnects from the remote server.
+
getHostmask(self, user, realhost=False, ip=False)
Returns the hostmask of the given user, if present. If the realhost option
+is given, return the real host of the user instead of the displayed host.
+If the ip option is given, return the IP address of the user (this overrides
+realhost).
+
getServer(self, numeric)
Finds the SID of the server a user is on.
initVars(self)
(Re)sets an IRC object to its default state. This should be called when
@@ -123,6 +137,17 @@ returning the SID of the server it's on 
isInternalServer(self, sid)
Returns whether the given SID is an internal PyLink server.
+
isManipulatableClient(self, uid)
Returns whether the given user is marked as an internal, manipulatable
+client. Usually, automatically spawned services clients should have this
+set True to prevent interactions with opers (like mode changes) from
+causing desyncs.
+ +
isOper(self, uid, allowAuthed=True, allowOper=True)
Returns whether the given user has operator status on PyLink. This can be achieved
+by either identifying to PyLink as admin (if allowAuthed is True),
+or having user mode +o set (if allowOper is True). At least one of
+allowAuthed or allowOper must be True for this to give any meaningful
+results.
+
logSetup(self)
Initializes any channel loggers defined for the current network.
msg(self, target, text, notice=False, source=None)
Handy function to send messages/notices to clients. Source
@@ -130,14 +155,43 @@ is optional, and defaults to the main PyLink&
nickToUid(self, nick)
Looks up the UID of a user with the given nick, if one is present.
+
parseModes(self, target, args)
Parses a modestring list into a list of (mode, argument) tuples.
+['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]
+
reply(self, text, notice=False, source=None)
Replies to the last caller in the right context (channel or PM).
+
reverseModes(self, target, modes, oldobj=None)
Reverses/Inverts the mode string or mode list given.

+Optionally, an oldobj argument can be given to look at an earlier state of
+a channel/user object, e.g. for checking the op status of a mode setter
+before their modes are processed and added to the channel state.

+This function allows both mode strings or mode lists. Example uses:
+    "+mi-lk test => "-mi+lk test"
+    "mi-k test => "-mi+k test"
+    [('+m', None), ('+r', None), ('+l', '3'), ('-o', 'person')
+     => {('-m', None), ('-r', None), ('-l', None), ('+o', 'person')})
+    {('s', None), ('+o', 'whoever') => {('-s', None), ('-o', 'whoever')})
+
runline(self, line)
Sends a command to the protocol module.
schedulePing(self)
Schedules periodic pings in a loop.
spawnMain(self)
Spawns the main PyLink client.
+
toLower(self, text)
Returns a lowercase representation of text based on the IRC object's
+casemapping (rfc1459 or ascii).
+ +
version(self)
Returns a detailed version string including the PyLink daemon version,
+the protocol module in use, and the server hostname.
+ +
+Static methods inherited from Irc:
+
joinModes(modes)
Takes a list of (mode, arg) tuples in parseModes() format, and
+joins them into a string.

+See testJoinModes in tests/test_utils.py for some examples.
+
Data descriptors inherited from Irc:
__dict__
@@ -176,7 +230,7 @@ Data and other attributes defined here:

Methods inherited from Protocol:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
be used for multi-word arguments that last until the end of a line.
@@ -208,18 +262,30 @@ Data descriptors inherited from Protocol:
and a configuration object.
-
__repr__(self)
Return repr(self).
+
__repr__(self)
+ +
applyModes(self, target, changedmodes)
Takes a list of parsed IRC modes, and applies them on the given target.

+The target can be either a channel or a user; this is handled automatically.
callCommand(self, source, text)
Calls a PyLink bot command. source is the caller's UID, and text is the
full, unparsed text of the message.
callHooks(self, hook_args)
Calls a hook function with the given hook args.
+
checkAuthenticated(self, uid, allowAuthed=True, allowOper=True)
Checks whether the given user has operator status on PyLink, raising
+NotAuthenticatedError and logging the access denial if not.
+
connect(self)
Runs the connect loop for the IRC object. This is usually called by
__init__ in a separate thread to allow multiple concurrent connections.
disconnect(self)
Handle disconnects from the remote server.
+
getHostmask(self, user, realhost=False, ip=False)
Returns the hostmask of the given user, if present. If the realhost option
+is given, return the real host of the user instead of the displayed host.
+If the ip option is given, return the IP address of the user (this overrides
+realhost).
+
getServer(self, numeric)
Finds the SID of the server a user is on.
initVars(self)
(Re)sets an IRC object to its default state. This should be called when
@@ -230,6 +296,17 @@ returning the SID of the server it's on 
isInternalServer(self, sid)
Returns whether the given SID is an internal PyLink server.
+
isManipulatableClient(self, uid)
Returns whether the given user is marked as an internal, manipulatable
+client. Usually, automatically spawned services clients should have this
+set True to prevent interactions with opers (like mode changes) from
+causing desyncs.
+ +
isOper(self, uid, allowAuthed=True, allowOper=True)
Returns whether the given user has operator status on PyLink. This can be achieved
+by either identifying to PyLink as admin (if allowAuthed is True),
+or having user mode +o set (if allowOper is True). At least one of
+allowAuthed or allowOper must be True for this to give any meaningful
+results.
+
logSetup(self)
Initializes any channel loggers defined for the current network.
msg(self, target, text, notice=False, source=None)
Handy function to send messages/notices to clients. Source
@@ -237,8 +314,24 @@ is optional, and defaults to the main PyLink&
nickToUid(self, nick)
Looks up the UID of a user with the given nick, if one is present.
+
parseModes(self, target, args)
Parses a modestring list into a list of (mode, argument) tuples.
+['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]
+
reply(self, text, notice=False, source=None)
Replies to the last caller in the right context (channel or PM).
+
reverseModes(self, target, modes, oldobj=None)
Reverses/Inverts the mode string or mode list given.

+Optionally, an oldobj argument can be given to look at an earlier state of
+a channel/user object, e.g. for checking the op status of a mode setter
+before their modes are processed and added to the channel state.

+This function allows both mode strings or mode lists. Example uses:
+    "+mi-lk test => "-mi+lk test"
+    "mi-k test => "-mi+k test"
+    [('+m', None), ('+r', None), ('+l', '3'), ('-o', 'person')
+     => {('-m', None), ('-r', None), ('-l', None), ('+o', 'person')})
+    {('s', None), ('+o', 'whoever') => {('-s', None), ('-o', 'whoever')})
+
run(self)
Main IRC loop which listens for messages.
runline(self, line)
Sends a command to the protocol module.
@@ -249,6 +342,19 @@ is optional, and defaults to the main PyLink&
spawnMain(self)
Spawns the main PyLink client.
+
toLower(self, text)
Returns a lowercase representation of text based on the IRC object's
+casemapping (rfc1459 or ascii).
+ +
version(self)
Returns a detailed version string including the PyLink daemon version,
+the protocol module in use, and the server hostname.
+ +
+Static methods defined here:
+
joinModes(modes)
Takes a list of (mode, arg) tuples in parseModes() format, and
+joins them into a string.

+See testJoinModes in tests/test_utils.py for some examples.
+
Data descriptors defined here:
__dict__
@@ -267,9 +373,9 @@ Data descriptors defined here:
-
PyLink IRC channel class.
 
  Methods defined here:
-
__init__(self, name=None)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, name=None)
-
__repr__(self)
Return repr(self).
+
__repr__(self)
deepcopy(self)
Returns a deep copy of the channel object.
@@ -320,9 +426,9 @@ name: The name of the server.
internal: Whether the server is an internal PyLink PseudoServer.
 
  Methods defined here:
-
__init__(self, uplink, name, internal=False, desc='(None given)')
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, uplink, name, internal=False, desc='(None given)')
-
__repr__(self)
Return repr(self).
+
__repr__(self)

Data descriptors defined here:
@@ -342,9 +448,9 @@ Data descriptors defined here:
PyLink IRC user class.
 
  Methods defined here:
-
__init__(self, nick, ts, uid, ident='null', host='null', realname='PyLink dummy client', realhost='null', ip='0.0.0.0', manipulatable=False)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, nick, ts, uid, ident='null', host='null', realname='PyLink dummy client', realhost='null', ip='0.0.0.0', manipulatable=False, opertype='IRC Operator')
-
__repr__(self)
Return repr(self).
+
__repr__(self)

Data descriptors defined here:
@@ -358,13 +464,75 @@ Data descriptors defined here:
+ + + + +
 
+class NotAuthenticatedError(builtins.Exception)
   Exception raised by checkAuthenticated() when a user fails authentication
+requirements.
 
 
Method resolution order:
+
NotAuthenticatedError
+
builtins.Exception
+
builtins.BaseException
+
builtins.object
+
+
+Data descriptors defined here:
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Methods inherited from builtins.Exception:
+
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
+ +
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
+ +
+Methods inherited from builtins.BaseException:
+
__delattr__(self, name, /)
Implement delattr(self, name).
+ +
__getattribute__(self, name, /)
Return getattr(self, name).
+ +
__reduce__(...)
+ +
__repr__(self, /)
Return repr(self).
+ +
__setattr__(self, name, value, /)
Implement setattr(self, name, value).
+ +
__setstate__(...)
+ +
__str__(self, /)
Return str(self).
+ +
with_traceback(...)
Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+ +
+Data descriptors inherited from builtins.BaseException:
+
__cause__
+
exception cause
+
+
__context__
+
exception context
+
+
__dict__
+
+
__suppress_context__
+
+
__traceback__
+
+
args
+
+

+ + + - - - + -
 
class Protocol(builtins.object)
    Base Protocol module class for PyLink.
 
  Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
be used for multi-word arguments that last until the end of a line.
@@ -388,9 +556,7 @@ Data descriptors defined here:
 
class ProtocolError(builtins.Exception)
   Common base class for all non-exit exceptions.
 
 
    
Method resolution order:
ProtocolError
builtins.Exception
@@ -414,7 +580,7 @@ Methods inherited from builtins.BaseExcept
__getattribute__(self, name, /)
Return getattr(self, name).
-
__reduce__(...)
helper for pickle
+
__reduce__(...)
__repr__(self, /)
Return repr(self).
@@ -450,13 +616,12 @@ Data descriptors inherited from builtins.B Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f8f3fcbc9d8>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f36077522f0>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/conf.html b/docs/technical/autogen/conf.html index 6dece02..947675c 100644 --- a/docs/technical/autogen/conf.html +++ b/docs/technical/autogen/conf.html @@ -47,8 +47,8 @@ configurations from arbitrary files.

Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fbb4a5c3840>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fcd1260b730>, {})}
confname = 'testconf'
fname = None
-testconf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fbb4a5c3840>, {})}
+testconf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fcd1260b730>, {})} \ No newline at end of file diff --git a/docs/technical/autogen/coreplugin.html b/docs/technical/autogen/coreplugin.html index 96c2c20..db9c302 100644 --- a/docs/technical/autogen/coreplugin.html +++ b/docs/technical/autogen/coreplugin.html @@ -17,10 +17,14 @@ Modules         -
gc
-
sys
+
classes
+conf
+
gc
+os
+
signal
+sys
utils
-
world
+world

@@ -42,13 +46,18 @@ Logs in to PyLink using the configured admini
load(irc, source, args)
<plugin name>.
 
Loads a plugin from the plugin folder.
-
main(irc=None)
+
rehash(irc, source, args)
takes no arguments.

+Reloads the configuration file for PyLink, (dis)connecting added/removed networks.
+Plugins must be manually reloaded.
reload(irc, source, args)
<plugin name>.
 
Loads a plugin from the plugin folder.
shutdown(irc, source, args)
takes no arguments.
 
Exits PyLink by disconnecting all networks.
+
sighup_handler(_signo, _stack_frame)
Handles SIGHUP by rehashing the PyLink daemon.
+
sigterm_handler(_signo, _stack_frame)
Handles SIGTERM gracefully by shutting down the PyLink daemon.
unload(irc, source, args)
<plugin name>.
 
Unloads a currently loaded plugin.
diff --git a/docs/technical/autogen/hybrid.html b/docs/technical/autogen/hybrid.html new file mode 100644 index 0000000..55c681e --- /dev/null +++ b/docs/technical/autogen/hybrid.html @@ -0,0 +1,466 @@ + +Python: module hybrid + + + +
+ +
 
+ 
hybrid
index
/home/gl/pylink/protocols/hybrid.py
+

+

+ + + + + +
 
+Modules
       
hashlib
+inspect
+logging
+os
+
re
+socket
+ssl
+string
+
structures
+sys
+threading
+time
+
utils
+world
+

+ + + + + +
 
+Classes
       
+
ts6.TS6Protocol(ts6_common.TS6BaseProtocol) +
+
+
HybridProtocol +
+
+
+

+ + + + + +
 
+Class = class HybridProtocol(ts6.TS6Protocol)
    
Method resolution order:
+
HybridProtocol
+
ts6.TS6Protocol
+
ts6_common.TS6BaseProtocol
+
classes.Protocol
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, irc)
+ +
connect(self)
Initializes a connection to a server.
+ +
handle_capab(self, numeric, command, args)
+ +
handle_eob(self, numeric, command, args)
+ +
handle_svsmode(self, numeric, command, args)
Handles SVSMODE, which is used for sending services metadata
+(vhosts, account logins), and other forced usermode changes.
+ +
handle_tburst(self, numeric, command, args)
Handles incoming topic burst (TBURST) commands.
+ +
handle_uid(self, numeric, command, args)
Handles Hybrid-style UID commands (user introduction). This is INCOMPATIBLE
+with standard TS6 implementations, as the arguments are slightly different.
+ +
spawnClient(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)
Spawns a new client with the given options.

+Note: No nick collision / valid nickname checks are done here; it is
+up to plugins to make sure they don't introduce anything invalid.
+ +
topicBurst(self, numeric, target, text)
Sends a topic change from a PyLink server. This is usually used on burst.
+ +
updateClient(self, target, field, text)
Updates the ident, host, or realname of a PyLink client.
+ +
+Methods inherited from ts6.TS6Protocol:
+
handle_472(self, numeric, command, args)
Handles the incoming 472 numeric.

+472 is sent to us when one of our clients tries to set a mode the uplink
+server doesn't support. In this case, we'll raise a warning to alert
+the administrator that certain extensions should be loaded for the best
+compatibility.
+ +
handle_bmask(self, numeric, command, args)
Handles incoming BMASK commands (ban propagation on burst).
+ +
handle_chghost(self, numeric, command, args)
Handles incoming CHGHOST commands.
+ +
handle_encap(self, numeric, command, args)
Handles the ENCAP command - encapsulated TS6 commands with a variety of
+subcommands used for different purposes.
+ +
handle_euid(self, numeric, command, args)
Handles incoming EUID commands (user introduction).
+ +
handle_invite(self, numeric, command, args)
Handles incoming INVITEs.
+ +
handle_join(self, numeric, command, args)
Handles incoming channel JOINs.
+ +
handle_mode(self, numeric, command, args)
Handles incoming user mode changes.
+ +
handle_pass(self, numeric, command, args)
Handles the PASS command, used to send the server's SID and negotiate
+passwords on connect.
+ +
handle_ping(self, source, command, args)
Handles incoming PING commands.
+ +
handle_pong(self, source, command, args)
Handles incoming PONG commands.
+ +
handle_server(self, numeric, command, args)
Handles 1) incoming legacy (no SID) server introductions,
+2) Sending server data in initial connection.
+ +
handle_sid(self, numeric, command, args)
Handles incoming server introductions.
+ +
handle_sjoin(self, servernumeric, command, args)
Handles incoming SJOIN commands.
+ +
handle_tb(self, numeric, command, args)
Handles incoming topic burst (TB) commands.
+ +
handle_tmode(self, numeric, command, args)
Handles incoming TMODE commands (channel mode change).
+ +
handle_whois(self, numeric, command, args)
Handles incoming WHOIS commands.

+Note: The core of WHOIS handling is done by coreplugin.py
+(IRCd-independent), and not here.
+ +
invite(self, numeric, target, channel)
Sends an INVITE from a PyLink client..
+ +
join(self, client, channel)
Joins a PyLink client to a channel.
+ +
kill(self, numeric, target, reason)
Sends a kill from a PyLink client/server.
+ +
knock(self, numeric, target, text)
Sends a KNOCK from a PyLink client.
+ +
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
+ +
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
+automatically by the Irc() internals; plugins shouldn't have to use this.
+ +
sjoin(self, server, channel, users, ts=None)
Sends an SJOIN for a group of users to a channel.

+The sender should always be a Server ID (SID). TS is optional, and defaults
+to the one we've stored in the channel state if not given.
+<users> is a list of (prefix mode, UID) pairs:

+Example uses:
+    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
+    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
+ +
+Methods inherited from ts6_common.TS6BaseProtocol:
+
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
+to unset AWAY status.
+ +
handle_away(self, numeric, command, args)
Handles incoming AWAY messages.
+ +
handle_error(self, numeric, command, args)
Handles ERROR messages - these mean that our uplink has disconnected us!
+ +
handle_events(self, data)
Event handler for TS6 protocols.

+This passes most commands to the various handle_ABCD() functions
+elsewhere defined protocol modules, coersing various sender prefixes
+from nicks and server names to UIDs and SIDs respectively,
+whenever possible.

+Commands sent without an explicit sender prefix will have them set to
+the SID of the uplink server.
+ +
handle_kick(self, source, command, args)
Handles incoming KICKs.
+ +
handle_kill(self, source, command, args)
Handles incoming KILLs.
+ +
handle_nick(self, numeric, command, args)
Handles incoming NICK changes.
+ +
handle_notice = handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_part(self, source, command, args)
Handles incoming PART commands.
+ +
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_quit(self, numeric, command, args)
Handles incoming QUIT commands.
+ +
handle_save(self, numeric, command, args)
Handles incoming SAVE messages, used to handle nick collisions.
+ +
handle_squit(self, numeric, command, args)
Handles incoming SQUITs (netsplits).
+ +
handle_topic(self, numeric, command, args)
Handles incoming TOPIC changes from clients. For topic bursts,
+TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.
+ +
handle_version(self, numeric, command, args)
Handles requests for the PyLink server version.
+ +
kick(self, numeric, channel, target, reason=None)
Sends kicks from a PyLink client/server.
+ +
message(self, numeric, target, text)
Sends a PRIVMSG from a PyLink client.
+ +
nick(self, numeric, newnick)
Changes the nick of a PyLink client.
+ +
notice(self, numeric, target, text)
Sends a NOTICE from a PyLink client.
+ +
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client, used for WHOIS
+replies.
+ +
parseTS6Args(self, args)
Similar to parseArgs(), but stripping leading colons from the first argument
+of a line (usually the sender field).
+ +
part(self, client, channel, reason=None)
Sends a part from a PyLink client.
+ +
quit(self, numeric, reason)
Quits a PyLink client.
+ +
spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
Spawns a server off a PyLink server. desc (server description)
+defaults to the one in the config. uplink defaults to the main PyLink
+server, and sid (the server ID) is automatically generated if not
+given.

+Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay
+option will be ignored if given.
+ +
squit(self, source, target, text='No reason given')
SQUITs a PyLink server.
+ +
topic(self, numeric, target, text)
Sends a TOPIC change from a PyLink client.
+ +
+Methods inherited from classes.Protocol:
+
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
+be used for multi-word arguments that last until the end of a line.
+ +
removeClient(self, numeric)
Internal function to remove a client from our internal state.
+ +
updateTS(self, channel, their_ts)
Compares the current TS of the channel given with the new TS, resetting
+all modes we have if the one given is older.
+ +
+Data descriptors inherited from classes.Protocol:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+class HybridProtocol(ts6.TS6Protocol)
    
Method resolution order:
+
HybridProtocol
+
ts6.TS6Protocol
+
ts6_common.TS6BaseProtocol
+
classes.Protocol
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, irc)
+ +
connect(self)
Initializes a connection to a server.
+ +
handle_capab(self, numeric, command, args)
+ +
handle_eob(self, numeric, command, args)
+ +
handle_svsmode(self, numeric, command, args)
Handles SVSMODE, which is used for sending services metadata
+(vhosts, account logins), and other forced usermode changes.
+ +
handle_tburst(self, numeric, command, args)
Handles incoming topic burst (TBURST) commands.
+ +
handle_uid(self, numeric, command, args)
Handles Hybrid-style UID commands (user introduction). This is INCOMPATIBLE
+with standard TS6 implementations, as the arguments are slightly different.
+ +
spawnClient(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)
Spawns a new client with the given options.

+Note: No nick collision / valid nickname checks are done here; it is
+up to plugins to make sure they don't introduce anything invalid.
+ +
topicBurst(self, numeric, target, text)
Sends a topic change from a PyLink server. This is usually used on burst.
+ +
updateClient(self, target, field, text)
Updates the ident, host, or realname of a PyLink client.
+ +
+Methods inherited from ts6.TS6Protocol:
+
handle_472(self, numeric, command, args)
Handles the incoming 472 numeric.

+472 is sent to us when one of our clients tries to set a mode the uplink
+server doesn't support. In this case, we'll raise a warning to alert
+the administrator that certain extensions should be loaded for the best
+compatibility.
+ +
handle_bmask(self, numeric, command, args)
Handles incoming BMASK commands (ban propagation on burst).
+ +
handle_chghost(self, numeric, command, args)
Handles incoming CHGHOST commands.
+ +
handle_encap(self, numeric, command, args)
Handles the ENCAP command - encapsulated TS6 commands with a variety of
+subcommands used for different purposes.
+ +
handle_euid(self, numeric, command, args)
Handles incoming EUID commands (user introduction).
+ +
handle_invite(self, numeric, command, args)
Handles incoming INVITEs.
+ +
handle_join(self, numeric, command, args)
Handles incoming channel JOINs.
+ +
handle_mode(self, numeric, command, args)
Handles incoming user mode changes.
+ +
handle_pass(self, numeric, command, args)
Handles the PASS command, used to send the server's SID and negotiate
+passwords on connect.
+ +
handle_ping(self, source, command, args)
Handles incoming PING commands.
+ +
handle_pong(self, source, command, args)
Handles incoming PONG commands.
+ +
handle_server(self, numeric, command, args)
Handles 1) incoming legacy (no SID) server introductions,
+2) Sending server data in initial connection.
+ +
handle_sid(self, numeric, command, args)
Handles incoming server introductions.
+ +
handle_sjoin(self, servernumeric, command, args)
Handles incoming SJOIN commands.
+ +
handle_tb(self, numeric, command, args)
Handles incoming topic burst (TB) commands.
+ +
handle_tmode(self, numeric, command, args)
Handles incoming TMODE commands (channel mode change).
+ +
handle_whois(self, numeric, command, args)
Handles incoming WHOIS commands.

+Note: The core of WHOIS handling is done by coreplugin.py
+(IRCd-independent), and not here.
+ +
invite(self, numeric, target, channel)
Sends an INVITE from a PyLink client..
+ +
join(self, client, channel)
Joins a PyLink client to a channel.
+ +
kill(self, numeric, target, reason)
Sends a kill from a PyLink client/server.
+ +
knock(self, numeric, target, text)
Sends a KNOCK from a PyLink client.
+ +
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
+ +
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
+automatically by the Irc() internals; plugins shouldn't have to use this.
+ +
sjoin(self, server, channel, users, ts=None)
Sends an SJOIN for a group of users to a channel.

+The sender should always be a Server ID (SID). TS is optional, and defaults
+to the one we've stored in the channel state if not given.
+<users> is a list of (prefix mode, UID) pairs:

+Example uses:
+    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
+    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
+ +
+Methods inherited from ts6_common.TS6BaseProtocol:
+
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
+to unset AWAY status.
+ +
handle_away(self, numeric, command, args)
Handles incoming AWAY messages.
+ +
handle_error(self, numeric, command, args)
Handles ERROR messages - these mean that our uplink has disconnected us!
+ +
handle_events(self, data)
Event handler for TS6 protocols.

+This passes most commands to the various handle_ABCD() functions
+elsewhere defined protocol modules, coersing various sender prefixes
+from nicks and server names to UIDs and SIDs respectively,
+whenever possible.

+Commands sent without an explicit sender prefix will have them set to
+the SID of the uplink server.
+ +
handle_kick(self, source, command, args)
Handles incoming KICKs.
+ +
handle_kill(self, source, command, args)
Handles incoming KILLs.
+ +
handle_nick(self, numeric, command, args)
Handles incoming NICK changes.
+ +
handle_notice = handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_part(self, source, command, args)
Handles incoming PART commands.
+ +
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_quit(self, numeric, command, args)
Handles incoming QUIT commands.
+ +
handle_save(self, numeric, command, args)
Handles incoming SAVE messages, used to handle nick collisions.
+ +
handle_squit(self, numeric, command, args)
Handles incoming SQUITs (netsplits).
+ +
handle_topic(self, numeric, command, args)
Handles incoming TOPIC changes from clients. For topic bursts,
+TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.
+ +
handle_version(self, numeric, command, args)
Handles requests for the PyLink server version.
+ +
kick(self, numeric, channel, target, reason=None)
Sends kicks from a PyLink client/server.
+ +
message(self, numeric, target, text)
Sends a PRIVMSG from a PyLink client.
+ +
nick(self, numeric, newnick)
Changes the nick of a PyLink client.
+ +
notice(self, numeric, target, text)
Sends a NOTICE from a PyLink client.
+ +
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client, used for WHOIS
+replies.
+ +
parseTS6Args(self, args)
Similar to parseArgs(), but stripping leading colons from the first argument
+of a line (usually the sender field).
+ +
part(self, client, channel, reason=None)
Sends a part from a PyLink client.
+ +
quit(self, numeric, reason)
Quits a PyLink client.
+ +
spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
Spawns a server off a PyLink server. desc (server description)
+defaults to the one in the config. uplink defaults to the main PyLink
+server, and sid (the server ID) is automatically generated if not
+given.

+Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay
+option will be ignored if given.
+ +
squit(self, source, target, text='No reason given')
SQUITs a PyLink server.
+ +
topic(self, numeric, target, text)
Sends a TOPIC change from a PyLink client.
+ +
+Methods inherited from classes.Protocol:
+
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
+be used for multi-word arguments that last until the end of a line.
+ +
removeClient(self, numeric)
Internal function to remove a client from our internal state.
+ +
updateTS(self, channel, their_ts)
Compares the current TS of the channel given with the new TS, resetting
+all modes we have if the one given is older.
+ +
+Data descriptors inherited from classes.Protocol:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f183a5c3bf8>, {})}
+confname = 'testconf'
+curdir = '/home/gl/pylink'
+files = None
+log = <logging.RootLogger object>
+logdir = '/home/gl/pylink/log'
+logformatter = <logging.Formatter object>
+stdout_level = 'CRITICAL'
+ \ No newline at end of file diff --git a/docs/technical/autogen/inspircd.html b/docs/technical/autogen/inspircd.html index d1edce2..422c4cc 100644 --- a/docs/technical/autogen/inspircd.html +++ b/docs/technical/autogen/inspircd.html @@ -18,12 +18,15 @@         - - - + - - - + -
hashlib
+inspect
logging
os
re
socket
ssl
-
sys
+string
+
structures
+sys
threading
time
utils
@@ -49,9 +52,7 @@
 
Class = class InspIRCdProtocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
InspIRCdProtocol
ts6_common.TS6BaseProtocol
@@ -60,7 +61,7 @@

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status.
@@ -135,8 +136,7 @@ servers.
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
-
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client, used for WHOIS
-replies.
+
numeric(self, source, numeric, target, text)
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.
@@ -151,7 +151,7 @@ Example uses:
    sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)]) -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -248,9 +248,7 @@ Data descriptors inherited from classes.Protocol
 
class InspIRCdProtocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
InspIRCdProtocol
ts6_common.TS6BaseProtocol
@@ -259,7 +257,7 @@ Data descriptors inherited from classes.Protocol

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status.
@@ -334,8 +332,7 @@ servers.
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
-
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client, used for WHOIS
-replies.
+
numeric(self, source, numeric, target, text)
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.
@@ -350,7 +347,7 @@ Example uses:
    sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)]) -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -448,13 +445,12 @@ Data descriptors inherited from classes.Protocol Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f5f06e526a8>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fb165343f28>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/log.html b/docs/technical/autogen/log.html index 9652463..0f134b3 100644 --- a/docs/technical/autogen/log.html +++ b/docs/technical/autogen/log.html @@ -24,7 +24,8 @@ access the global logger object by importing 
logging
os
sys
-

+world
+

-
 
@@ -56,8 +57,7 @@ access the global logger object by importing 
Methods defined here:
-
__init__(self, irc, channel, level=None)
Initializes the instance - basically setting the formatter to None
-and the filter list to empty.
+
__init__(self, irc, channel, level=None)
emit(self, record)
Logs a record to the configured channels for the network given.
@@ -125,7 +125,7 @@ The default is to allow the record to be this and the record is then dropped. Returns a zero value if a record
is to be dropped, else non-zero.
 
-.. versionchanged:: 3.2
+.. versionchanged: 3.2
 
   Allow filters to be just callables. @@ -154,13 +154,12 @@ Data descriptors inherited from logging.Filterer Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fdc93aefc80>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f81857da950>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/nefarious.html b/docs/technical/autogen/nefarious.html new file mode 100644 index 0000000..e01c878 --- /dev/null +++ b/docs/technical/autogen/nefarious.html @@ -0,0 +1,471 @@ + +Python: module nefarious + + + + + +
 
+ 
nefarious
index
/home/gl/pylink/protocols/nefarious.py
+

nefarious.py: Nefarious IRCu protocol module for PyLink.

+

+ + + + + +
 
+Modules
       
base64
+hashlib
+inspect
+logging
+
os
+socket
+ssl
+struct
+
structures
+sys
+threading
+time
+
utils
+world
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
P10SIDGenerator +
+
+
classes.Protocol(builtins.object) +
+
+
P10Protocol +
+
+
utils.IncrementalUIDGenerator(builtins.object) +
+
+
P10UIDGenerator +
+
+
+

+ + + + + +
 
+Class = class P10Protocol(classes.Protocol)
    
Method resolution order:
+
P10Protocol
+
classes.Protocol
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, irc)
+ +
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
+to unset AWAY status.
+ +
checkCloakChange(self, uid)
Checks for cloak changes on the given UID.
+ +
connect(self)
Initializes a connection to a server.
+ +
handle_account(self, numeric, command, args)
Handles services account changes.
+ +
handle_away(self, numeric, command, args)
Handles incoming AWAY messages.
+ +
handle_burst(self, source, command, args)
Handles the BURST command, used for bursting channels on link.

+This is equivalent to SJOIN on most IRCds.
+ +
handle_clearmode(self, numeric, command, args)
Handles CLEARMODE, which is used to clear a channel's modes.
+ +
handle_create = handle_join(self, source, command, args)
+ +
handle_end_of_burst(self, source, command, args)
Handles end of burst from our uplink.
+ +
handle_events(self, data)
Event handler for the P10 protocol.

+This passes most commands to the various handle_ABCD() functions defined elsewhere in the
+protocol modules, coersing various sender prefixes from nicks and server names to P10
+"numeric nicks", whenever possible.

+Commands sent without an explicit sender prefix are treated as originating from the uplink
+server.
+ +
handle_fake(self, numeric, command, args)
Handles incoming FAKE hostmask changes.
+ +
handle_invite(self, source, command, args)
Handles incoming INVITEs.
+ +
handle_join(self, source, command, args)
Handles incoming JOINs and channel creations.
+ +
handle_kick(self, source, command, args)
Handles incoming KICKs.
+ +
handle_kill(self, numeric, command, args)
Handles incoming KILLs.
+ +
handle_mode(self, source, command, args)
Handles mode changes.
+ +
handle_nick(self, source, command, args)
Handles the NICK command, used for user introductions and nick changes.
+ +
handle_notice = handle_privmsg(self, source, command, args)
+ +
handle_opmode = handle_mode(self, source, command, args)
+ +
handle_part(self, source, command, args)
Handles user parts.
+ +
handle_pass(self, source, command, args)
Handles authentication with our uplink.
+ +
handle_ping(self, source, command, args)
Handles incoming PING requests.
+ +
handle_pong(self, source, command, args)
Handles incoming PONGs.
+ +
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_quit(self, numeric, command, args)
Handles incoming QUITs.
+ +
handle_server(self, source, command, args)
Handles incoming server introductions.
+ +
handle_squit(self, numeric, command, args)
Handles incoming SQUITs.
+ +
handle_topic(self, source, command, args)
Handles TOPIC changes.
+ +
handle_version(self, numeric, command, args)
Handles requests for the PyLink server version.
+ +
handle_whois(self, numeric, command, args)
Handles incoming WHOIS requests.
+ +
invite(self, numeric, target, channel)
Sends INVITEs from a PyLink client.
+ +
join(self, client, channel)
Joins a PyLink client to a channel.
+ +
kick(self, numeric, channel, target, reason=None)
Sends kicks from a PyLink client/server.
+ +
kill(self, numeric, target, reason)
Sends a kill from a PyLink client/server.
+ +
knock(self, numeric, target, text)
+ +
message(self, numeric, target, text)
Sends a PRIVMSG from a PyLink client.
+ +
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
+ +
nick(self, numeric, newnick)
Changes the nick of a PyLink client.
+ +
notice(self, numeric, target, text)
Sends a NOTICE from a PyLink client.
+ +
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client. This is used for WHOIS
+replies.
+ +
part(self, client, channel, reason=None)
Sends a part from a PyLink client.
+ +
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
+automatically by the Irc() internals; plugins shouldn't have to use this.
+ +
quit(self, numeric, reason)
Quits a PyLink client.
+ +
sjoin(self, server, channel, users, ts=None)
Sends an SJOIN for a group of users to a channel.

+The sender should always be a Server ID (SID). TS is optional, and defaults
+to the one we've stored in the channel state if not given.
+<users> is a list of (prefix mode, UID) pairs:

+Example uses:
+    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
+    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
+ +
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.

+Note: No nick collision / valid nickname checks are done here; it is
+up to plugins to make sure they don't introduce anything invalid.
+ +
spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
Spawns a server off a PyLink server. desc (server description)
+defaults to the one in the config. uplink defaults to the main PyLink
+server, and sid (the server ID) is automatically generated if not
+given.

+Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay
+option will be ignored if given.
+ +
squit(self, source, target, text='No reason given')
SQUITs a PyLink server.
+ +
topic(self, numeric, target, text)
Sends a TOPIC change from a PyLink client.
+ +
topicBurst(self, numeric, target, text)
Sends a TOPIC change from a PyLink server.
+ +
updateClient(self, target, field, text)
Updates the ident or host of any connected client.
+ +
+Static methods defined here:
+
decode_p10_ip(ip)
Decodes a P10 IP.
+ +
+Methods inherited from classes.Protocol:
+
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
+be used for multi-word arguments that last until the end of a line.
+ +
removeClient(self, numeric)
Internal function to remove a client from our internal state.
+ +
updateTS(self, channel, their_ts)
Compares the current TS of the channel given with the new TS, resetting
+all modes we have if the one given is older.
+ +
+Data descriptors inherited from classes.Protocol:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+class P10Protocol(classes.Protocol)
    
Method resolution order:
+
P10Protocol
+
classes.Protocol
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, irc)
+ +
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
+to unset AWAY status.
+ +
checkCloakChange(self, uid)
Checks for cloak changes on the given UID.
+ +
connect(self)
Initializes a connection to a server.
+ +
handle_account(self, numeric, command, args)
Handles services account changes.
+ +
handle_away(self, numeric, command, args)
Handles incoming AWAY messages.
+ +
handle_burst(self, source, command, args)
Handles the BURST command, used for bursting channels on link.

+This is equivalent to SJOIN on most IRCds.
+ +
handle_clearmode(self, numeric, command, args)
Handles CLEARMODE, which is used to clear a channel's modes.
+ +
handle_create = handle_join(self, source, command, args)
+ +
handle_end_of_burst(self, source, command, args)
Handles end of burst from our uplink.
+ +
handle_events(self, data)
Event handler for the P10 protocol.

+This passes most commands to the various handle_ABCD() functions defined elsewhere in the
+protocol modules, coersing various sender prefixes from nicks and server names to P10
+"numeric nicks", whenever possible.

+Commands sent without an explicit sender prefix are treated as originating from the uplink
+server.
+ +
handle_fake(self, numeric, command, args)
Handles incoming FAKE hostmask changes.
+ +
handle_invite(self, source, command, args)
Handles incoming INVITEs.
+ +
handle_join(self, source, command, args)
Handles incoming JOINs and channel creations.
+ +
handle_kick(self, source, command, args)
Handles incoming KICKs.
+ +
handle_kill(self, numeric, command, args)
Handles incoming KILLs.
+ +
handle_mode(self, source, command, args)
Handles mode changes.
+ +
handle_nick(self, source, command, args)
Handles the NICK command, used for user introductions and nick changes.
+ +
handle_notice = handle_privmsg(self, source, command, args)
+ +
handle_opmode = handle_mode(self, source, command, args)
+ +
handle_part(self, source, command, args)
Handles user parts.
+ +
handle_pass(self, source, command, args)
Handles authentication with our uplink.
+ +
handle_ping(self, source, command, args)
Handles incoming PING requests.
+ +
handle_pong(self, source, command, args)
Handles incoming PONGs.
+ +
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+ +
handle_quit(self, numeric, command, args)
Handles incoming QUITs.
+ +
handle_server(self, source, command, args)
Handles incoming server introductions.
+ +
handle_squit(self, numeric, command, args)
Handles incoming SQUITs.
+ +
handle_topic(self, source, command, args)
Handles TOPIC changes.
+ +
handle_version(self, numeric, command, args)
Handles requests for the PyLink server version.
+ +
handle_whois(self, numeric, command, args)
Handles incoming WHOIS requests.
+ +
invite(self, numeric, target, channel)
Sends INVITEs from a PyLink client.
+ +
join(self, client, channel)
Joins a PyLink client to a channel.
+ +
kick(self, numeric, channel, target, reason=None)
Sends kicks from a PyLink client/server.
+ +
kill(self, numeric, target, reason)
Sends a kill from a PyLink client/server.
+ +
knock(self, numeric, target, text)
+ +
message(self, numeric, target, text)
Sends a PRIVMSG from a PyLink client.
+ +
mode(self, numeric, target, modes, ts=None)
Sends mode changes from a PyLink client/server.
+ +
nick(self, numeric, newnick)
Changes the nick of a PyLink client.
+ +
notice(self, numeric, target, text)
Sends a NOTICE from a PyLink client.
+ +
numeric(self, source, numeric, target, text)
Sends raw numerics from a server to a remote client. This is used for WHOIS
+replies.
+ +
part(self, client, channel, reason=None)
Sends a part from a PyLink client.
+ +
ping(self, source=None, target=None)
Sends a PING to a target server. Periodic PINGs are sent to our uplink
+automatically by the Irc() internals; plugins shouldn't have to use this.
+ +
quit(self, numeric, reason)
Quits a PyLink client.
+ +
sjoin(self, server, channel, users, ts=None)
Sends an SJOIN for a group of users to a channel.

+The sender should always be a Server ID (SID). TS is optional, and defaults
+to the one we've stored in the channel state if not given.
+<users> is a list of (prefix mode, UID) pairs:

+Example uses:
+    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
+    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
+ +
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.

+Note: No nick collision / valid nickname checks are done here; it is
+up to plugins to make sure they don't introduce anything invalid.
+ +
spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
Spawns a server off a PyLink server. desc (server description)
+defaults to the one in the config. uplink defaults to the main PyLink
+server, and sid (the server ID) is automatically generated if not
+given.

+Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay
+option will be ignored if given.
+ +
squit(self, source, target, text='No reason given')
SQUITs a PyLink server.
+ +
topic(self, numeric, target, text)
Sends a TOPIC change from a PyLink client.
+ +
topicBurst(self, numeric, target, text)
Sends a TOPIC change from a PyLink server.
+ +
updateClient(self, target, field, text)
Updates the ident or host of any connected client.
+ +
+Static methods defined here:
+
decode_p10_ip(ip)
Decodes a P10 IP.
+ +
+Methods inherited from classes.Protocol:
+
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
+be used for multi-word arguments that last until the end of a line.
+ +
removeClient(self, numeric)
Internal function to remove a client from our internal state.
+ +
updateTS(self, channel, their_ts)
Compares the current TS of the channel given with the new TS, resetting
+all modes we have if the one given is older.
+ +
+Data descriptors inherited from classes.Protocol:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+class P10SIDGenerator(builtins.object)
    Methods defined here:
+
__init__(self, irc)
+ +
next_sid(self)
Returns the next available SID.
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class P10UIDGenerator(utils.IncrementalUIDGenerator)
   Implements an incremental P10 UID Generator.
 
 
Method resolution order:
+
P10UIDGenerator
+
utils.IncrementalUIDGenerator
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, sid)
+ +
+Methods inherited from utils.IncrementalUIDGenerator:
+
increment(self, pos=None)
Increments the UID generator to the next available UID.
+ +
next_uid(self)
Returns the next unused UID for the server.
+ +
+Data descriptors inherited from utils.IncrementalUIDGenerator:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+Functions
       
p10b64encode(num, length=2)
Encodes a given numeric using P10 Base64 numeric nicks, as documented at
+https://github.com/evilnet/nefarious2/blob/a29b63144/doc/p10.txt#L69-L92
+

+ + + + + +
 
+Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f4243176488>, {})}
+confname = 'testconf'
+curdir = '/home/gl/pylink'
+files = None
+log = <logging.RootLogger object>
+logdir = '/home/gl/pylink/log'
+logformatter = <logging.Formatter object>
+stdout_level = 'CRITICAL'
+ \ No newline at end of file diff --git a/docs/technical/autogen/structures.html b/docs/technical/autogen/structures.html new file mode 100644 index 0000000..d8d8555 --- /dev/null +++ b/docs/technical/autogen/structures.html @@ -0,0 +1,144 @@ + +Python: module structures + + + + + +
 
+ 
structures
index
/home/gl/pylink/structures.py
+

structures.py - PyLink data structures module.

+This module contains custom data structures that may be useful in various situations.

+

+ + + + + +
 
+Modules
       
collections
+

+ + + + + +
 
+Classes
       
+
collections.defaultdict(builtins.dict) +
+
+
KeyedDefaultdict +
+
+
+

+ + + + + + + +
 
+class KeyedDefaultdict(collections.defaultdict)
   Subclass of defaultdict allowing the key to be passed to the default factory.
 
 
Method resolution order:
+
KeyedDefaultdict
+
collections.defaultdict
+
builtins.dict
+
builtins.object
+
+
+Methods defined here:
+
__missing__(self, key)
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Methods inherited from collections.defaultdict:
+
__copy__(...)
D.copy() -> a shallow copy of D.
+ +
__getattribute__(self, name, /)
Return getattr(self, name).
+ +
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
+ +
__reduce__(...)
Return state information for pickling.
+ +
__repr__(self, /)
Return repr(self).
+ +
copy(...)
D.copy() -> a shallow copy of D.
+ +
+Data descriptors inherited from collections.defaultdict:
+
default_factory
+
Factory for default value called by __missing__().
+
+
+Methods inherited from builtins.dict:
+
__contains__(self, key, /)
True if D has a key k, else False.
+ +
__delitem__(self, key, /)
Delete self[key].
+ +
__eq__(self, value, /)
Return self==value.
+ +
__ge__(self, value, /)
Return self>=value.
+ +
__getitem__(...)
x.__getitem__(y) <==> x[y]
+ +
__gt__(self, value, /)
Return self>value.
+ +
__iter__(self, /)
Implement iter(self).
+ +
__le__(self, value, /)
Return self<=value.
+ +
__len__(self, /)
Return len(self).
+ +
__lt__(self, value, /)
Return self<value.
+ +
__ne__(self, value, /)
Return self!=value.
+ +
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
+ +
__setitem__(self, key, value, /)
Set self[key] to value.
+ +
__sizeof__(...)
D.__sizeof__() -> size of D in memory, in bytes
+ +
clear(...)
D.clear() -> None.  Remove all items from D.
+ +
fromkeys(iterable, value=None, /) from builtins.type
Returns a new dict with keys from iterable and values equal to value.
+ +
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
+ +
items(...)
D.items() -> a set-like object providing a view on D's items
+ +
keys(...)
D.keys() -> a set-like object providing a view on D's keys
+ +
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+If key is not found, d is returned if given, otherwise KeyError is raised
+ +
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
+2-tuple; but raise KeyError if D is empty.
+ +
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
+ +
update(...)
D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
+If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
+If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
+In either case, this is followed by: for k in F:  D[k] = F[k]
+ +
values(...)
D.values() -> an object providing a view on D's values
+ +
+Data and other attributes inherited from builtins.dict:
+
__hash__ = None
+ +

+ \ No newline at end of file diff --git a/docs/technical/autogen/ts6.html b/docs/technical/autogen/ts6.html index 575f776..4f3226a 100644 --- a/docs/technical/autogen/ts6.html +++ b/docs/technical/autogen/ts6.html @@ -18,12 +18,15 @@         - - - + - - - + -
hashlib
+inspect
logging
os
re
socket
ssl
-
sys
+string
+
structures
+sys
threading
time
utils
@@ -49,9 +52,7 @@
 
Class = class TS6Protocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
TS6Protocol
ts6_common.TS6BaseProtocol
@@ -60,7 +61,7 @@

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
connect(self)
Initializes a connection to a server.
@@ -136,7 +137,7 @@ Example uses:
    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)]) -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -241,9 +242,7 @@ Data descriptors inherited from classes.Protocol
 
class TS6Protocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
TS6Protocol
ts6_common.TS6BaseProtocol
@@ -252,7 +251,7 @@ Data descriptors inherited from classes.Protocol

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
connect(self)
Initializes a connection to a server.
@@ -328,7 +327,7 @@ Example uses:
    sjoin('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])
    sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)]) -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -434,13 +433,12 @@ Data descriptors inherited from classes.Protocol Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f7bc713a598>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f8cbdc44c80>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/ts6_common.html b/docs/technical/autogen/ts6_common.html index e1929b9..d5a91c8 100644 --- a/docs/technical/autogen/ts6_common.html +++ b/docs/technical/autogen/ts6_common.html @@ -18,12 +18,15 @@        
hashlib
+inspect
logging
os
socket
ssl
-sys
-
threading
+string
+structures
+
sys
+threading
time
utils
world
@@ -35,12 +38,24 @@
       
+
builtins.object +
+
+
TS6SIDGenerator +
+
classes.Protocol(builtins.object)
TS6BaseProtocol
+
utils.IncrementalUIDGenerator(builtins.object) +
+
+
TS6UIDGenerator +
+

@@ -48,9 +63,7 @@ - - - +
 
class TS6BaseProtocol(classes.Protocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
TS6BaseProtocol
classes.Protocol
@@ -58,6 +71,8 @@

Methods defined here:
+
__init__(self, irc)
+
away(self, source, text)
Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status.
@@ -130,8 +145,6 @@ option will be ignored if given.
Methods inherited from classes.Protocol:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
-
parseArgs(self, args)
Parses a string of RFC1459-style arguments split into a list, where ":" may
be used for multi-word arguments that last until the end of a line.
@@ -148,6 +161,74 @@ Data descriptors inherited from classes.Protocol
__weakref__
list of weak references to the object (if defined)
+

+ + + + + + + +
 
+class TS6SIDGenerator(builtins.object)
   TS6 SID Generator. <query> is a 3 character string with any combination of
+uppercase letters, digits, and #'s. it must contain at least one #,
+which are used by the generator as a wildcard. On every next_sid() call,
+the first available wildcard character (from the right) will be
+incremented to generate the next SID.

+When there are no more available SIDs left (SIDs are not reused, only
+incremented), RuntimeError is raised.

+Example queries:
+    "1#A" would give: 10A, 11A, 12A ... 19A, 1AA, 1BA ... 1ZA (36 total results)
+    "#BQ" would give: 0BQ, 1BQ, 2BQ ... 9BQ (10 total results)
+    "6##" would give: 600, 601, 602, ... 60Y, 60Z, 610, 611, ... 6ZZ (1296 total results)
 
 Methods defined here:
+
__init__(self, irc)
+ +
increment(self, pos=2)
Increments the SID generator to the next available SID.
+ +
next_sid(self)
Returns the next unused TS6 SID for the server.
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class TS6UIDGenerator(utils.IncrementalUIDGenerator)
   Implements an incremental TS6 UID Generator.
 
 
Method resolution order:
+
TS6UIDGenerator
+
utils.IncrementalUIDGenerator
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, sid)
+ +
+Methods inherited from utils.IncrementalUIDGenerator:
+
increment(self, pos=None)
Increments the UID generator to the next available UID.
+ +
next_uid(self)
Returns the next unused UID for the server.
+ +
+Data descriptors inherited from utils.IncrementalUIDGenerator:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+

@@ -155,13 +236,12 @@ Data descriptors inherited from classes.Protocol Data -
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f2667895488>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f683a0b9d90>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/unreal.html b/docs/technical/autogen/unreal.html index 05206f9..4d1cf3d 100644 --- a/docs/technical/autogen/unreal.html +++ b/docs/technical/autogen/unreal.html @@ -19,11 +19,14 @@         - - - + - - - + -
codecs
hashlib
+inspect
logging
os
re
socket
-
ssl
+ssl
+
string
+structures
sys
threading
time
@@ -50,9 +53,7 @@
 
Class = class UnrealProtocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
UnrealProtocol
ts6_common.TS6BaseProtocol
@@ -61,7 +62,7 @@

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
checkCloakChange(self, uid, parsedmodes)
Checks whether +x/-x was set in the mode query, and changes the
hostname of the user given to or from their cloaked host if True.
@@ -80,8 +81,12 @@ hostname of the user given to or from th
handle_join(self, numeric, command, args)
Handles the UnrealIRCd JOIN command.
+
handle_kill(self, numeric, command, args)
Handles incoming KILLs.
+
handle_mode(self, numeric, command, args)
+
handle_nick(self, numeric, command, args)
Handles NICK changes, and legacy NICK introductions from pre-4.0 servers.
+
handle_notice = handle_privmsg(self, source, command, args)
handle_pass(self, numeric, command, args)
@@ -90,9 +95,9 @@ hostname of the user given to or from th
handle_pong(self, source, command, args)
-
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+
handle_privmsg(self, source, command, args)
-
handle_protoctl(self, numeric, command, args)
+
handle_protoctl(self, numeric, command, args)
Handles protocol negotiation.
handle_server(self, numeric, command, args)
Handles the SERVER command, which is used for both authentication and
introducing legacy (non-SID) servers.
@@ -149,7 +154,7 @@ Example uses:
Note that for UnrealIRCd, no mode data is sent in an SJOIN command, only
The channel name, TS, and user list. -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -179,10 +184,6 @@ the SID of the uplink server.
handle_kick(self, source, command, args)
Handles incoming KICKs.
-
handle_kill(self, source, command, args)
Handles incoming KILLs.
- -
handle_nick(self, numeric, command, args)
Handles incoming NICK changes.
-
handle_part(self, source, command, args)
Handles incoming PART commands.
handle_quit(self, numeric, command, args)
Handles incoming QUIT commands.
@@ -245,9 +246,7 @@ Data descriptors inherited from classes.Protocol
 
class UnrealProtocol(ts6_common.TS6BaseProtocol)
   Base Protocol module class for PyLink.
 
 
    
Method resolution order:
UnrealProtocol
ts6_common.TS6BaseProtocol
@@ -256,7 +255,7 @@ Data descriptors inherited from classes.Protocol

Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, irc)
checkCloakChange(self, uid, parsedmodes)
Checks whether +x/-x was set in the mode query, and changes the
hostname of the user given to or from their cloaked host if True.
@@ -275,8 +274,12 @@ hostname of the user given to or from th
handle_join(self, numeric, command, args)
Handles the UnrealIRCd JOIN command.
+
handle_kill(self, numeric, command, args)
Handles incoming KILLs.
+
handle_mode(self, numeric, command, args)
+
handle_nick(self, numeric, command, args)
Handles NICK changes, and legacy NICK introductions from pre-4.0 servers.
+
handle_notice = handle_privmsg(self, source, command, args)
handle_pass(self, numeric, command, args)
@@ -285,9 +288,9 @@ hostname of the user given to or from th
handle_pong(self, source, command, args)
-
handle_privmsg(self, source, command, args)
Handles incoming PRIVMSG/NOTICE.
+
handle_privmsg(self, source, command, args)
-
handle_protoctl(self, numeric, command, args)
+
handle_protoctl(self, numeric, command, args)
Handles protocol negotiation.
handle_server(self, numeric, command, args)
Handles the SERVER command, which is used for both authentication and
introducing legacy (non-SID) servers.
@@ -344,7 +347,7 @@ Example uses:
Note that for UnrealIRCd, no mode data is sent in an SJOIN command, only
The channel name, TS, and user list. -
spawnClient(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)
Spawns a client with nick <nick> on the given IRC connection.
+
spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
Spawns a new client with the given options.
 
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
@@ -374,10 +377,6 @@ the SID of the uplink server.
handle_kick(self, source, command, args)
Handles incoming KICKs.
-
handle_kill(self, source, command, args)
Handles incoming KILLs.
- -
handle_nick(self, numeric, command, args)
Handles incoming NICK changes.
-
handle_part(self, source, command, args)
Handles incoming PART commands.
handle_quit(self, numeric, command, args)
Handles incoming QUIT commands.
@@ -441,13 +440,12 @@ Data descriptors inherited from classes.Protocol Data
       conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f0f1f40fc80>, {})}
+
conf = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7fcbbf211620>, {})}
confname = 'testconf'
curdir = '/home/gl/pylink'
files = None
log = <logging.RootLogger object>
logdir = '/home/gl/pylink/log'
logformatter = <logging.Formatter object>
-stdout_handler = <logging.StreamHandler object>
stdout_level = 'CRITICAL'
\ No newline at end of file diff --git a/docs/technical/autogen/utils.html b/docs/technical/autogen/utils.html index 4c9831d..cc11f71 100644 --- a/docs/technical/autogen/utils.html +++ b/docs/technical/autogen/utils.html @@ -20,15 +20,13 @@ framework.

Modules         -
collections
-conf
-
importlib
-inspect
+
conf
+importlib
os
re
string
world
-

+

 
@@ -36,23 +34,10 @@ framework.

       
-
builtins.Exception(builtins.BaseException) -
-
-
NotAuthenticatedError -
-
builtins.object
-
TS6SIDGenerator -
TS6UIDGenerator -
-
-
collections.defaultdict(builtins.dict) -
-
-
KeyedDefaultdict +
IncrementalUIDGenerator
@@ -60,224 +45,18 @@ framework.

+class IncrementalUIDGenerator(builtins.object) - - -
 
-class KeyedDefaultdict(collections.defaultdict)
   Subclass of defaultdict allowing the key to be passed to the default factory.
 
 
Method resolution order:
-
KeyedDefaultdict
-
collections.defaultdict
-
builtins.dict
-
builtins.object
-
-
-Methods defined here:
-
__missing__(self, key)
__missing__(key) # Called by __getitem__ for missing key; pseudo-code:
-if self.default_factory is None: raise KeyError((key,))
-self[key] = value = self.default_factory()
-return value
- -
-Data descriptors defined here:
-
__dict__
-
dictionary for instance variables (if defined)
-
-
__weakref__
-
list of weak references to the object (if defined)
-
-
-Methods inherited from collections.defaultdict:
-
__copy__(...)
D.copy() -> a shallow copy of D.
- -
__getattribute__(self, name, /)
Return getattr(self, name).
- -
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
- -
__reduce__(...)
Return state information for pickling.
- -
__repr__(self, /)
Return repr(self).
- -
copy(...)
D.copy() -> a shallow copy of D.
- -
-Data descriptors inherited from collections.defaultdict:
-
default_factory
-
Factory for default value called by __missing__().
-
-
-Methods inherited from builtins.dict:
-
__contains__(self, key, /)
True if D has a key k, else False.
- -
__delitem__(self, key, /)
Delete self[key].
- -
__eq__(self, value, /)
Return self==value.
- -
__ge__(self, value, /)
Return self>=value.
- -
__getitem__(...)
x.__getitem__(y) <==> x[y]
- -
__gt__(self, value, /)
Return self>value.
- -
__iter__(self, /)
Implement iter(self).
- -
__le__(self, value, /)
Return self<=value.
- -
__len__(self, /)
Return len(self).
- -
__lt__(self, value, /)
Return self<value.
- -
__ne__(self, value, /)
Return self!=value.
- -
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
- -
__setitem__(self, key, value, /)
Set self[key] to value.
- -
__sizeof__(...)
D.__sizeof__() -> size of D in memory, in bytes
- -
clear(...)
D.clear() -> None.  Remove all items from D.
- -
fromkeys(iterable, value=None, /) from builtins.type
Returns a new dict with keys from iterable and values equal to value.
- -
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
- -
items(...)
D.items() -> a set-like object providing a view on D's items
- -
keys(...)
D.keys() -> a set-like object providing a view on D's keys
- -
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
-If key is not found, d is returned if given, otherwise KeyError is raised
- -
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
-2-tuple; but raise KeyError if D is empty.
- -
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- -
update(...)
D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
-If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
-If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
-In either case, this is followed by: for k in F:  D[k] = F[k]
- -
values(...)
D.values() -> an object providing a view on D's values
- -
-Data and other attributes inherited from builtins.dict:
-
__hash__ = None
- -

- - - - - - - -
 
-class NotAuthenticatedError(builtins.Exception)
   Exception raised by checkAuthenticated() when a user fails authentication
-requirements.
 
 
Method resolution order:
-
NotAuthenticatedError
-
builtins.Exception
-
builtins.BaseException
-
builtins.object
-
-
-Data descriptors defined here:
-
__weakref__
-
list of weak references to the object (if defined)
-
-
-Methods inherited from builtins.Exception:
-
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
- -
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
- -
-Methods inherited from builtins.BaseException:
-
__delattr__(self, name, /)
Implement delattr(self, name).
- -
__getattribute__(self, name, /)
Return getattr(self, name).
- -
__reduce__(...)
helper for pickle
- -
__repr__(self, /)
Return repr(self).
- -
__setattr__(self, name, value, /)
Implement setattr(self, name, value).
- -
__setstate__(...)
- -
__str__(self, /)
Return str(self).
- -
with_traceback(...)
Exception.with_traceback(tb) --
-set self.__traceback__ to tb and return self.
- -
-Data descriptors inherited from builtins.BaseException:
-
__cause__
-
exception cause
-
-
__context__
-
exception context
-
-
__dict__
-
-
__suppress_context__
-
-
__traceback__
-
-
args
-
-

- - - - - - - -
 
-class TS6SIDGenerator(builtins.object)
   TS6 SID Generator. <query> is a 3 character string with any combination of
-uppercase letters, digits, and #'s. it must contain at least one #,
-which are used by the generator as a wildcard. On every next_sid() call,
-the first available wildcard character (from the right) will be
-incremented to generate the next SID.

-When there are no more available SIDs left (SIDs are not reused, only
-incremented), RuntimeError is raised.

-Example queries:
-    "1#A" would give: 10A, 11A, 12A ... 19A, 1AA, 1BA ... 1ZA (36 total results)
-    "#BQ" would give: 0BQ, 1BQ, 2BQ ... 9BQ (10 total results)
-    "6##" would give: 600, 601, 602, ... 60Y, 60Z, 610, 611, ... 6ZZ (1296 total results)
 
 Methods defined here:
-
__init__(self, irc)
Initialize self.  See help(type(self)) for accurate signature.
- -
increment(self, pos=2)
Increments the SID generator to the next available SID.
- -
next_sid(self)
Returns the next unused TS6 SID for the server.
- -
-Data descriptors defined here:
-
__dict__
-
dictionary for instance variables (if defined)
-
-
__weakref__
-
list of weak references to the object (if defined)
-
-

- - - - - -
 
-class TS6UIDGenerator(builtins.object)
   TS6 UID Generator module, adapted from InspIRCd source:
+
Incremental UID Generator module, adapted from InspIRCd source:
https://github.com/inspircd/inspircd/blob/f449c6b296ab/src/server.cpp#L85-L156
 
  Methods defined here:
-
__init__(self, sid)
Initialize self.  See help(type(self)) for accurate signature.
+
__init__(self, sid)
-
increment(self, pos=5)
Increments the SID generator to the next available SID.
+
increment(self, pos=None)
Increments the UID generator to the next available UID.
-
next_uid(self)
Returns the next unused TS6 UID for the server.
+
next_uid(self)
Returns the next unused UID for the server.

Data descriptors defined here:
@@ -298,11 +77,9 @@ Data descriptors defined here:
add_hook(func, command)
Binds a hook function to the given command name.
applyModes(irc, target, changedmodes)
Takes a list of parsed IRC modes, and applies them on the given target.
 
-The target can be either a channel or a user; this is handled automatically.
-
checkAuthenticated(irc, uid, allowAuthed=True, allowOper=True)
Checks whether the given user has operator status on PyLink, raising
-NotAuthenticatedError and logging the access denial if not.
-
fullVersion(irc)
Returns a detailed version string including the PyLink daemon version,
-the protocol module in use, and the server hostname.
+The target can be either a channel or a user; this is handled automatically.

+This method is deprecated. Use irc.applyModes() instead.
getDatabaseName(dbname)
Returns a database filename with the given base DB name appropriate for the
current PyLink instance.
 
@@ -310,45 +87,16 @@ This returns '<dbname>.db' if the running co (config.yml), and '<dbname>-<config name>.db' for anything else. For example,
if this is called from an instance running as './pylink testing.yml', it
would return '<dbname>-testing.db'.
-
getHostmask(irc, user, realhost=False, ip=False)
Returns the hostmask of the given user, if present. If the realhost option
-is given, return the real host of the user instead of the displayed host.
-If the ip option is given, return the IP address of the user (this overrides
-realhost).
getProtocolModule(protoname)
Imports and returns the protocol module requested.
isChannel(s)
Returns whether the string given is a valid channel name.
isHostmask(text)
Returns whether the given text is a valid hostmask.
-
isManipulatableClient(irc, uid)
Returns whether the given user is marked as an internal, manipulatable
-client. Usually, automatically spawned services clients should have this
-set True to prevent interactions with opers (like mode changes) from
-causing desyncs.
isNick(s, nicklen=None)
Returns whether the string given is a valid nick.
-
isOper(irc, uid, allowAuthed=True, allowOper=True)
Returns whether the given user has operator status on PyLink. This can be achieved
-by either identifying to PyLink as admin (if allowAuthed is True),
-or having user mode +o set (if allowOper is True). At least one of
-allowAuthed or allowOper must be True for this to give any meaningful
-results.
isServerName(s)
Returns whether the string given is a valid IRC server name.
-
joinModes(modes)
Takes a list of (mode, arg) tuples in parseModes() format, and
-joins them into a string.

-See testJoinModes in tests/test_utils.py for some examples.
loadModuleFromFolder(name, folder)
Imports and returns a module, if existing, from a specific folder.
parseModes(irc, target, args)
Parses a modestring list into a list of (mode, argument) tuples.
-['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]
-
reverseModes(irc, target, modes, oldobj=None)
Reverses/Inverts the mode string or mode list given.
+['+mitl-o', '3', 'person'] => [('+m', None), ('+i', None), ('+t', None), ('+l', '3'), ('-o', 'person')]
 
-Optionally, an oldobj argument can be given to look at an earlier state of
-a channel/user object, e.g. for checking the op status of a mode setter
-before their modes are processed and added to the channel state.

-This function allows both mode strings or mode lists. Example uses:
-    "+mi-lk test => "-mi+lk test"
-    "mi-k test => "-mi+k test"
-    [('+m', None), ('+r', None), ('+l', '3'), ('-o', 'person')
-     => {('-m', None), ('-r', None), ('-l', None), ('+o', 'person')})
-    {('s', None), ('+o', 'whoever') => {('-s', None), ('-o', 'whoever')})
-
toLower(irc, text)
Returns a lowercase representation of text based on the IRC object's
-casemapping (rfc1459 or ascii).
+This method is deprecated. Use irc.parseModes() instead.

diff --git a/docs/technical/autogen/world.html b/docs/technical/autogen/world.html index 486840f..04275cf 100644 --- a/docs/technical/autogen/world.html +++ b/docs/technical/autogen/world.html @@ -37,6 +37,6 @@ started = <threading.Event object>
testing = True
testing_ircd = 'inspircd'
-version = 'v0.7.0-dev-29-gc8a3514'
+version = 'v0.8-alpha2-5-g6b40c97'
whois_handlers = []
\ No newline at end of file