3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Move NotAuthenticatedError class back into utils

This is needed because ServiceBot exists in utils, and utils cannot import classes without a bad import loop happening.
This commit is contained in:
James Lu 2016-05-14 10:05:18 -07:00
parent 7d11f8c7e0
commit 0c7faed213
2 changed files with 8 additions and 8 deletions

View File

@ -27,13 +27,6 @@ import structures
class ProtocolError(Exception): class ProtocolError(Exception):
pass pass
class NotAuthenticatedError(Exception):
"""
Exception raised by checkAuthenticated() when a user fails authentication
requirements.
"""
pass
### Internal classes (users, servers, channels) ### Internal classes (users, servers, channels)
class Irc(): class Irc():
@ -898,7 +891,7 @@ class Irc():
if not self.isOper(uid, allowAuthed=allowAuthed, allowOper=allowOper): if not self.isOper(uid, allowAuthed=allowAuthed, allowOper=allowOper):
log.warning('(%s) Access denied for %s calling %r', self.name, log.warning('(%s) Access denied for %s calling %r', self.name,
self.getHostmask(uid), lastfunc) self.getHostmask(uid), lastfunc)
raise NotAuthenticatedError("You are not authenticated!") raise utils.NotAuthenticatedError("You are not authenticated!")
return True return True
class IrcUser(): class IrcUser():

View File

@ -15,6 +15,13 @@ from log import log
import world import world
import conf import conf
class NotAuthenticatedError(Exception):
"""
Exception raised by checkAuthenticated() when a user fails authentication
requirements.
"""
pass
class IncrementalUIDGenerator(): class IncrementalUIDGenerator():
""" """
Incremental UID Generator module, adapted from InspIRCd source: Incremental UID Generator module, adapted from InspIRCd source: