mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Merge branch 'testing' of github.com:ProgVal/Limnoria into mkaysi
This commit is contained in:
commit
4e91e84f51
@ -58,7 +58,7 @@ conf.registerGroup(Unix, 'fortune')
|
|||||||
conf.registerGlobalValue(Unix.fortune, 'command',
|
conf.registerGlobalValue(Unix.fortune, 'command',
|
||||||
registry.String(utils.findBinaryInPath('fortune') or '', _("""Determines
|
registry.String(utils.findBinaryInPath('fortune') or '', _("""Determines
|
||||||
what command will be called for the fortune command.""")))
|
what command will be called for the fortune command.""")))
|
||||||
conf.registerGlobalValue(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.registerGlobalValue(Unix.fortune, 'equal',
|
||||||
@ -66,7 +66,7 @@ conf.registerGlobalValue(Unix.fortune, '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
|
||||||
fortune program.""")))
|
fortune program.""")))
|
||||||
conf.registerGlobalValue(Unix.fortune, 'offensive',
|
conf.registerChannelValue(Unix.fortune, 'offensive',
|
||||||
registry.Boolean(False, _("""Determines whether fortune will retrieve
|
registry.Boolean(False, _("""Determines whether fortune will retrieve
|
||||||
offensive fortunes along with the normal fortunes. This sends the -a
|
offensive fortunes along with the normal fortunes. This sends the -a
|
||||||
option to the fortune program.""")))
|
option to the fortune program.""")))
|
||||||
|
@ -196,14 +196,15 @@ class Unix(callbacks.Plugin):
|
|||||||
|
|
||||||
Returns a fortune from the *nix fortune program.
|
Returns a fortune from the *nix fortune program.
|
||||||
"""
|
"""
|
||||||
|
channel = msg.args[0]
|
||||||
fortuneCmd = self.registryValue('fortune.command')
|
fortuneCmd = self.registryValue('fortune.command')
|
||||||
if fortuneCmd:
|
if fortuneCmd:
|
||||||
args = [fortuneCmd]
|
args = [fortuneCmd]
|
||||||
if self.registryValue('fortune.short'):
|
if self.registryValue('fortune.short', channel):
|
||||||
args.append('-s')
|
args.append('-s')
|
||||||
if self.registryValue('fortune.equal'):
|
if self.registryValue('fortune.equal'):
|
||||||
args.append('-e')
|
args.append('-e')
|
||||||
if self.registryValue('fortune.offensive'):
|
if self.registryValue('fortune.offensive', channel):
|
||||||
args.append('-a')
|
args.append('-a')
|
||||||
args.extend(self.registryValue('fortune.files'))
|
args.extend(self.registryValue('fortune.files'))
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user