Unix: Make fortune.equal and fortune.file channel-specific.

This commit is contained in:
Valentin Lorentz 2016-03-01 19:20:58 +01:00
parent bf02f79847
commit 25a913a82b
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ conf.registerGlobalValue(Unix.fortune, 'command',
conf.registerChannelValue(Unix.fortune, 'short', conf.registerChannelValue(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. This sends the -s option to the fortune program."""))) used if possible. This sends the -s option to the fortune program.""")))
conf.registerGlobalValue(Unix.fortune, 'equal', conf.registerChannelValue(Unix.fortune, 'equal',
registry.Boolean(True, _("""Determines whether fortune will give equal registry.Boolean(True, _("""Determines whether fortune will give equal
weight to the different fortune databases. If false, then larger weight to the different fortune databases. If false, then larger
databases will be given more weight. This sends the -e option to the databases will be given more weight. This sends the -e option to the

View File

@ -207,11 +207,11 @@ class Unix(callbacks.Plugin):
args = [fortuneCmd] args = [fortuneCmd]
if self.registryValue('fortune.short', channel): if self.registryValue('fortune.short', channel):
args.append('-s') args.append('-s')
if self.registryValue('fortune.equal'): if self.registryValue('fortune.equal', channel):
args.append('-e') args.append('-e')
if self.registryValue('fortune.offensive', channel): if self.registryValue('fortune.offensive', channel):
args.append('-a') args.append('-a')
args.extend(self.registryValue('fortune.files')) args.extend(self.registryValue('fortune.files', channel))
try: try:
with open(os.devnull) as null: with open(os.devnull) as null:
inst = subprocess.Popen(args, inst = subprocess.Popen(args,