mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-24 03:29:28 +01:00
a few Raise=True additions
This commit is contained in:
parent
4557b867fe
commit
bdca894522
23
src/User.py
23
src/User.py
@ -209,19 +209,17 @@ class User(callbacks.Privmsg):
|
|||||||
'includes a nick, then an exclamation point (!), then '
|
'includes a nick, then an exclamation point (!), then '
|
||||||
'a user, then an at symbol (@), then a host. Feel '
|
'a user, then an at symbol (@), then a host. Feel '
|
||||||
'free to use wildcards (* and ?, which work just like '
|
'free to use wildcards (* and ?, which work just like '
|
||||||
'they do on the command line) in any of these parts.')
|
'they do on the command line) in any of these parts.',
|
||||||
return
|
Raise=True)
|
||||||
try:
|
try:
|
||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.errorNoUser()
|
irc.errorNoUser(Raise=True)
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
otherId = ircdb.users.getUserId(hostmask)
|
otherId = ircdb.users.getUserId(hostmask)
|
||||||
if otherId != id:
|
if otherId != id:
|
||||||
irc.error('That hostmask is already registered.')
|
irc.error('That hostmask is already registered.', Raise=True)
|
||||||
return
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
if not user.checkPassword(password) and \
|
if not user.checkPassword(password) and \
|
||||||
@ -229,20 +227,19 @@ class User(callbacks.Privmsg):
|
|||||||
try:
|
try:
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||||
return
|
Raise=True)
|
||||||
if not u.checkCapability('owner'):
|
if not u.checkCapability('owner'):
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||||
return
|
Raise=True)
|
||||||
try:
|
try:
|
||||||
user.addHostmask(hostmask)
|
user.addHostmask(hostmask)
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e), Raise=True)
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e), Raise=True)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
def removehostmask(self, irc, msg, args):
|
def removehostmask(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user