mirror of https://github.com/Mikaela/Limnoria.git
Add a couple more options to supybot.unix.fortune
This commit is contained in:
parent
ec3a76c607
commit
bb4d3cda49
|
@ -93,6 +93,13 @@ conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'command',
|
|||
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'short',
|
||||
registry.Boolean(True, """Determines whether only short fortunes will be
|
||||
used if possible."""))
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'equalWeight',
|
||||
registry.Boolean(True, """Determines whether fortune will give equal
|
||||
weight to the different fortune databases. If false, then larger
|
||||
databases will be given more weight."""))
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'offensive',
|
||||
registry.Boolean(False, """Determines whether fortune will retrieve
|
||||
offensive fortunes along with the normal fortunes."""))
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'files',
|
||||
registry.SpaceSeparatedListOfStrings([], """Determines what specific file
|
||||
(if any) will be used with the fortune command; if none is given, the
|
||||
|
@ -222,7 +229,11 @@ class Unix(callbacks.Privmsg):
|
|||
args = [fortuneCmd]
|
||||
if self.registryValue('fortune.short'):
|
||||
args.append('-s')
|
||||
args.extend(self.registryValue('fortune.files')))
|
||||
if self.registryValue('fortune.equalWeight'):
|
||||
args.append('-e')
|
||||
if self.registryValue('fortune.offensive'):
|
||||
args.append('-a')
|
||||
args.extend(self.registryValue('fortune.files'))
|
||||
(r, w) = popen2.popen4(args)
|
||||
try:
|
||||
lines = r.readlines()
|
||||
|
|
Loading…
Reference in New Issue