2015-06-07 07:17:45 +02:00
|
|
|
class IrcUser():
|
|
|
|
def __init__(self, nick, ts, uid, ident='null', host='null',
|
|
|
|
realname='PyLink dummy client', realhost='null',
|
2015-06-21 05:58:25 +02:00
|
|
|
ip='0.0.0.0', modes=set()):
|
2015-06-07 07:17:45 +02:00
|
|
|
self.nick = nick
|
|
|
|
self.ts = ts
|
|
|
|
self.uid = uid
|
|
|
|
self.ident = ident
|
|
|
|
self.host = host
|
|
|
|
self.realhost = realhost
|
|
|
|
self.ip = ip
|
|
|
|
self.realname = realname
|
2015-06-21 05:36:35 +02:00
|
|
|
self.modes = modes
|
2015-06-07 07:17:45 +02:00
|
|
|
|
|
|
|
self.identified = False
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return repr(self.__dict__)
|
|
|
|
|
|
|
|
class IrcServer():
|
2015-06-22 00:00:33 +02:00
|
|
|
"""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.
|
|
|
|
"""
|
|
|
|
def __init__(self, uplink, name, internal=False):
|
2015-06-07 07:17:45 +02:00
|
|
|
self.uplink = uplink
|
|
|
|
self.users = []
|
2015-06-22 00:00:33 +02:00
|
|
|
self.internal = internal
|
|
|
|
self.name = name.lower()
|
2015-06-07 07:17:45 +02:00
|
|
|
def __repr__(self):
|
|
|
|
return repr(self.__dict__)
|
2015-06-07 08:04:11 +02:00
|
|
|
|
|
|
|
class IrcChannel():
|
|
|
|
def __init__(self):
|
2015-06-07 18:43:13 +02:00
|
|
|
self.users = set()
|
2015-06-07 18:33:35 +02:00
|
|
|
'''
|
2015-06-07 08:04:11 +02:00
|
|
|
self.ops = []
|
|
|
|
self.halfops = []
|
|
|
|
self.voices = []
|
2015-06-07 18:33:35 +02:00
|
|
|
'''
|
2015-06-07 08:04:11 +02:00
|
|
|
def __repr__(self):
|
|
|
|
return repr(self.__dict__)
|
2015-07-04 03:07:01 +02:00
|
|
|
|
|
|
|
class ProtocolError(Exception):
|
|
|
|
pass
|