diff --git a/docs/technical/autogen/classes.html b/docs/technical/autogen/classes.html new file mode 100644 index 0000000..00f5777 --- /dev/null +++ b/docs/technical/autogen/classes.html @@ -0,0 +1,402 @@ + +Python: module classes + + + + + +
 
+ 
classes
index
/home/gl/pylink/classes.py
+

classes.py - Base classes for PyLink IRC Services.

+This module contains the base classes used by PyLink, including threaded IRC
+connections and objects used to represent IRC servers, users, and channels.

+Here be dragons.

+

+ + + + + +
 
+Modules
       
hashlib
+socket
+
ssl
+threading
+
time
+utils
+
world
+

+ + + + + +
 
+Classes
       
+
builtins.Exception(builtins.BaseException) +
+
+
ProtocolError +
+
+
builtins.object +
+
+
Irc +
+
+
FakeIRC +
+
+
IrcChannel +
IrcServer +
IrcUser +
Protocol +
+
+
FakeProto +
+
+
+
+
+

+ + + + + + + +
 
+class FakeIRC(Irc)
   Fake IRC object used for unit tests.
 
 
Method resolution order:
+
FakeIRC
+
Irc
+
builtins.object
+
+
+Methods defined here:
+
connect(self)
+ +
run(self, data)
Queues a message to the fake IRC server.
+ +
send(self, data)
+ +
takeCommands(self, msgs)
Returns a list of commands parsed from the output of takeMsgs().
+ +
takeHooks(self)
Returns a list of hook arguments sent by the protocol module since
+the last takeHooks() call.
+ +
takeMsgs(self)
Returns a list of messages sent by the protocol module since
+the last takeMsgs() call, so we can track what has been sent.
+ +
+Methods inherited from Irc:
+
__init__(self, netname, proto, conf)
Initializes an IRC object. This takes 3 variables: the network name
+(a string), the name of the protocol module to use for this connection,
+and a configuration object.
+ +
__repr__(self)
+ +
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.
+ +
disconnect(self)
Closes the IRC connection.
+ +
initVars(self)
(Re)sets an IRC object to its default state. This should be called when
+an IRC object is first created, and on every reconnection to a network.
+ +
msg(self, target, text, notice=False, source=None)
Handy function to send messages/notices to clients. Source
+is optional, and defaults to the main PyLink client if not specified.
+ +
reply(self, text, notice=False, source=None)
Replies to the last caller in the right context (channel or PM).
+ +
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.
+ +
+Data descriptors inherited from Irc:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class FakeProto(Protocol)
   Dummy protocol module for testing purposes.
 
 
Method resolution order:
+
FakeProto
+
Protocol
+
builtins.object
+
+
+Methods defined here:
+
connect(self)
+ +
handle_events(self, data)
+ +
joinClient(self, client, channel)
+ +
spawnClient(self, nick, *args, **kwargs)
+ +
+Data and other attributes defined here:
+
Class = <class 'classes.FakeProto'>
Dummy protocol module for testing purposes.
+ +
+Methods inherited from Protocol:
+
__init__(self, irc)
# TODO: Future state-keeping things will go here
+ +
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 Protocol:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class Irc(builtins.object)
   Base IRC object for PyLink.
 
 Methods defined here:
+
__init__(self, netname, proto, conf)
Initializes an IRC object. This takes 3 variables: the network name
+(a string), the name of the protocol module to use for this connection,
+and a configuration object.
+ +
__repr__(self)
+ +
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.
+ +
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)
Closes the IRC connection.
+ +
initVars(self)
(Re)sets an IRC object to its default state. This should be called when
+an IRC object is first created, and on every reconnection to a network.
+ +
msg(self, target, text, notice=False, source=None)
Handy function to send messages/notices to clients. Source
+is optional, and defaults to the main PyLink client if not specified.
+ +
reply(self, text, notice=False, source=None)
Replies to the last caller in the right context (channel or PM).
+ +
run(self)
Main IRC loop which listens for messages.
+ +
runline(self, line)
Sends a command to the protocol module.
+ +
schedulePing(self)
Schedules periodic pings in a loop.
+ +
send(self, data)
Sends raw text to the uplink server.
+ +
spawnMain(self)
Spawns the main PyLink client.
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class IrcChannel(builtins.object)
   PyLink IRC channel class.
 
 Methods defined here:
+
__init__(self)
+ +
__repr__(self)
+ +
deepcopy(self)
Returns a deep copy of the channel object.
+ +
removeuser(self, target)
Removes a user from a channel.
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class IrcServer(builtins.object)
   PyLink IRC server class.

+uplink: The SID of this IrcServer instance's uplink. This is set to None
+        for the main PyLink PseudoServer!
+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)')
+ +
__repr__(self)
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class IrcUser(builtins.object)
   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)
+ +
__repr__(self)
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+class Protocol(builtins.object)
    Methods defined here:
+
__init__(self, irc)
# TODO: Future state-keeping things will go here
+ +
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 defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + +
 
+class ProtocolError(builtins.Exception)
    
Method resolution order:
+
ProtocolError
+
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
+
+

+ + + + + +
 
+Data
       log = <logging.RootLogger object>
+ \ No newline at end of file diff --git a/docs/technical/autogen/conf.html b/docs/technical/autogen/conf.html new file mode 100644 index 0000000..57faab7 --- /dev/null +++ b/docs/technical/autogen/conf.html @@ -0,0 +1,54 @@ + +Python: module conf + + + + + +
 
+ 
conf
index
/home/gl/pylink/conf.py
+

conf.py - PyLink configuration core.

+This module is used to access the complete configuration for the current
+PyLink instance. It will load the config on first import, taking the
+configuration file name from the first command-line argument, but defaulting
+to 'config.yml' if this isn't given.

+If world.testing is set to True, it will return a preset testing configuration
+instead.

+This module also provides simple checks for validating and loading YAML-format
+configurations from arbitrary files.

+

+ + + + + +
 
+Modules
       
sys
+
world
+
yaml
+

+ + + + + +
 
+Functions
       
loadConf(fname, errors_fatal=True)
Loads a PyLink configuration file from the filename given.
+
validateConf(conf)
Validates a parsed configuration dict.
+

+ + + + + +
 
+Data
       conf = {'bot': {'loglevel': 'CRITICAL', 'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'servers': defaultdict(<function <lambda> at 0x7f9f56c70ea0>, {})}
+confname = 'testconf'
+fname = None
+testconf = {'bot': {'loglevel': 'CRITICAL', 'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'servers': defaultdict(<function <lambda> at 0x7f9f56c70ea0>, {})}
+ \ No newline at end of file diff --git a/docs/technical/inspircd.html b/docs/technical/autogen/inspircd.html similarity index 99% rename from docs/technical/inspircd.html rename to docs/technical/autogen/inspircd.html index 21b1b36..73e1b64 100644 --- a/docs/technical/inspircd.html +++ b/docs/technical/autogen/inspircd.html @@ -100,7 +100,7 @@ initial server linking phase.

handle_opertype(self, numeric, command, args)
Handles incoming OPERTYPE, which is used to denote an oper up.
 
-This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal
+This calls the internal hook CLIENT_OPERED, sets the internal
opertype of the client, and assumes setting user mode +o on the caller.
handle_ping(self, source, command, args)
Handles incoming PING commands, so we don't time out.
@@ -292,7 +292,7 @@ initial server linking phase.
handle_opertype(self, numeric, command, args)
Handles incoming OPERTYPE, which is used to denote an oper up.
 
-This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal
+This calls the internal hook CLIENT_OPERED, sets the internal
opertype of the client, and assumes setting user mode +o on the caller.
handle_ping(self, source, command, args)
Handles incoming PING commands, so we don't time out.
diff --git a/docs/technical/autogen/log.html b/docs/technical/autogen/log.html new file mode 100644 index 0000000..af8e7ea --- /dev/null +++ b/docs/technical/autogen/log.html @@ -0,0 +1,42 @@ + +Python: module log + + + + + +
 
+ 
log
index
/home/gl/pylink/log.py
+

log.py - PyLink logging module.

+This module contains the logging portion of the PyLink framework. Plugins can
+access the global logger object by importing "log" from this module
+(from log import log).

+

+ + + + + +
 
+Modules
       
logging
+
os
+
sys
+

+ + + + + +
 
+Data
       conf = {'bot': {'loglevel': 'CRITICAL', 'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'servers': defaultdict(<function <lambda> at 0x7f9f56d40bf8>, {})}
+confname = 'testconf'
+curdir = '/home/gl/pylink'
+level = 50
+log = <logging.RootLogger object>
+logdir = '/home/gl/pylink/log'
+logfile = <logging.FileHandler object>
+logformat = <logging.Formatter object>
+ \ No newline at end of file diff --git a/docs/technical/utils.html b/docs/technical/autogen/utils.html similarity index 100% rename from docs/technical/utils.html rename to docs/technical/autogen/utils.html diff --git a/docs/technical/autogen/world.html b/docs/technical/autogen/world.html new file mode 100644 index 0000000..2032029 --- /dev/null +++ b/docs/technical/autogen/world.html @@ -0,0 +1,43 @@ + +Python: module world + + + + + +
 
+ 
world
index
/home/gl/pylink/world.py
+

world.py: Stores global state variables for PyLink.

+

+ + + + + +
 
+Modules
       
os
+
subprocess
+
threading
+

+ + + + + +
 
+Data
       commands = defaultdict(<class 'list'>, {})
+hooks = defaultdict(<class 'list'>, {})
+networkobjects = {}
+plugins = {}
+plugins_folder = '/home/gl/pylink/plugins'
+protocols_folder = '/home/gl/pylink/protocols'
+schedulers = {}
+source = 'https://github.com/GLolol/PyLink'
+started = <threading.Event object>
+testing = True
+testing_ircd = 'inspircd'
+version = 'v0.5-dev-41-gbf2b256'
+whois_handlers = []
+ \ No newline at end of file diff --git a/docs/technical/pmodule-spec.md b/docs/technical/pmodule-spec.md index ae8f226..f90044d 100644 --- a/docs/technical/pmodule-spec.md +++ b/docs/technical/pmodule-spec.md @@ -2,7 +2,7 @@ In PyLink, each protocol module is a single file consisting of a protocol class, and a global `Class` attribute that is set equal to it (e.g. `Class = InspIRCdProtocol`). These classes should be based off of either [`classes.Protocol`](https://github.com/GLolol/PyLink/blob/e4fb64aebaf542122c70a8f3a49061386a00b0ca/classes.py#L532), a boilerplate class that only defines a few basic things, or [`ts6_common.TS6BaseProtocol`](https://github.com/GLolol/PyLink/blob/0.5.0-dev/protocols/ts6_common.py), which includes elements of the TS6 protocol that are shared by the InspIRCd, UnrealIRCd, and TS6 protocols. IRC objects load protocol modules by creating an instance of its main class, and sends it commands accordingly. -See also: [inspircd.html](inspircd.html) for auto-generated documentation the InspIRCd protocol module. +See also: [autogen/inspircd.html](autogen/inspircd.html) for auto-generated documentation the InspIRCd protocol module. ## Tasks diff --git a/docs/technical/using-utils.md b/docs/technical/using-utils.md index 06d09d1..a045487 100644 --- a/docs/technical/using-utils.md +++ b/docs/technical/using-utils.md @@ -1 +1 @@ -See [utils.html](utils.html) for auto-generated documentation for the utils module. +See [autogen/utils.html](autogen/utils.html) for auto-generated documentation for the utils module.