Allow multiple fortune files.

This commit is contained in:
Jeremy Fincher 2004-08-31 15:53:57 +00:00
parent 7ede876aaa
commit 53c951cc04

View File

@ -93,11 +93,11 @@ conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'command',
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'short', conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'short',
registry.Boolean(True, """Determines whether only short fortunes will be registry.Boolean(True, """Determines whether only short fortunes will be
used if possible.""")) used if possible."""))
conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'file', conf.registerGlobalValue(conf.supybot.plugins.Unix.fortune, 'files',
registry.String('', """Determines what specific file (if any) will be used registry.SpaceSeparatedListOfStrings([], """Determines what specific file
with the fortune command; if none is given, the system-wide default will (if any) will be used with the fortune command; if none is given, the
be used. Do note that this fortune file must be placed with the rest of system-wide default will be used. Do note that this fortune file must be
your system's fortune files.""")) placed with the rest of your system's fortune files."""))
conf.registerGroup(conf.supybot.plugins.Unix, 'spell') conf.registerGroup(conf.supybot.plugins.Unix, 'spell')
conf.registerGlobalValue(conf.supybot.plugins.Unix.spell, 'command', conf.registerGlobalValue(conf.supybot.plugins.Unix.spell, 'command',
@ -222,8 +222,7 @@ class Unix(callbacks.Privmsg):
args = [fortuneCmd] args = [fortuneCmd]
if self.registryValue('fortune.short'): if self.registryValue('fortune.short'):
args.append('-s') args.append('-s')
if self.registryValue('fortune.file'): args.extend(self.registryValue('fortune.files')))
args.append(self.registryValue('fortune.file'))
(r, w) = popen2.popen4(args) (r, w) = popen2.popen4(args)
try: try:
lines = r.readlines() lines = r.readlines()