PassGen: syntactic cleanup

This commit is contained in:
James Lu 2015-07-10 09:08:39 -07:00
parent 0cfe3fbb04
commit cc43f5b473

View File

@ -41,7 +41,7 @@ try:
except ImportError: except ImportError:
# Placeholder that allows to run the plugin on a bot # Placeholder that allows to run the plugin on a bot
# without the i18n module # without the i18n module
_ = lambda x:x _ = lambda x: x
class PassGen(callbacks.Plugin): class PassGen(callbacks.Plugin):
"""Generates passwords on the fly!""" """Generates passwords on the fly!"""
@ -49,7 +49,7 @@ class PassGen(callbacks.Plugin):
def mkpasswd(self, irc, msg, args, len): def mkpasswd(self, irc, msg, args, len):
"""[<len>] """[<len>]
Makes a randomly generated password, [<len>] characters long if Makes a randomly generated password, [<len>] characters long if
specified. Otherwise, uses the bot's configured default length. specified. Otherwise, uses the bot's configured default length.
(see config plugins.PassGen.defaultLen)""" (see config plugins.PassGen.defaultLen)"""
@ -58,7 +58,7 @@ class PassGen(callbacks.Plugin):
len = self.registryValue('defaultLen') len = self.registryValue('defaultLen')
elif len > maxlen: elif len > maxlen:
irc.error("The specified length ({}) is longer than the maximum " irc.error("The specified length ({}) is longer than the maximum "
"allowed on this bot. Current maximum: {}".format(len, maxlen), \ "allowed on this bot. Current maximum: {}".format(len, maxlen),
Raise=True) Raise=True)
rg = random.SystemRandom() rg = random.SystemRandom()
letters = string.ascii_letters + string.digits + self.registryValue('symbols') letters = string.ascii_letters + string.digits + self.registryValue('symbols')