mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Made --private only show private plugins.
This commit is contained in:
parent
79bb9029ef
commit
46383f9fc7
12
src/Misc.py
12
src/Misc.py
@ -74,20 +74,22 @@ class Misc(callbacks.Privmsg):
|
|||||||
|
|
||||||
Lists the commands available in the given plugin. If no plugin is
|
Lists the commands available in the given plugin. If no plugin is
|
||||||
given, lists the public plugins available. If --private is given,
|
given, lists the public plugins available. If --private is given,
|
||||||
lists all commands, not just the public ones.
|
lists the private plugins.
|
||||||
"""
|
"""
|
||||||
(optlist, rest) = getopt.getopt(args, '', ['private'])
|
(optlist, rest) = getopt.getopt(args, '', ['private'])
|
||||||
evenPrivate = False
|
private = False
|
||||||
for (option, argument) in optlist:
|
for (option, argument) in optlist:
|
||||||
if option == '--private':
|
if option == '--private':
|
||||||
evenPrivate = True
|
private = True
|
||||||
name = privmsgs.getArgs(rest, required=0, optional=1)
|
name = privmsgs.getArgs(rest, required=0, optional=1)
|
||||||
name = callbacks.canonicalName(name)
|
name = callbacks.canonicalName(name)
|
||||||
if not name:
|
if not name:
|
||||||
def isPublic(cb):
|
def isPublic(cb):
|
||||||
name = cb.name()
|
name = cb.name()
|
||||||
return conf.supybot.plugins.get(name).public() or evenPrivate
|
return conf.supybot.plugins.get(name).public()
|
||||||
names = [cb.name() for cb in irc.callbacks if isPublic(cb)]
|
names = [cb.name() for cb in irc.callbacks
|
||||||
|
if (private and not isPublic(cb)) or
|
||||||
|
(not private and isPublic(cb))]
|
||||||
names.sort()
|
names.sort()
|
||||||
irc.reply(utils.commaAndify(names))
|
irc.reply(utils.commaAndify(names))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user