3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +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):
pass
class NotAuthenticatedError(Exception):
"""
Exception raised by checkAuthenticated() when a user fails authentication
requirements.
"""
pass
### Internal classes (users, servers, channels)
class Irc():
@ -898,7 +891,7 @@ class Irc():
if not self.isOper(uid, allowAuthed=allowAuthed, allowOper=allowOper):
log.warning('(%s) Access denied for %s calling %r', self.name,
self.getHostmask(uid), lastfunc)
raise NotAuthenticatedError("You are not authenticated!")
raise utils.NotAuthenticatedError("You are not authenticated!")
return True
class IrcUser():

View File

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