summaryrefslogtreecommitdiffstats
path: root/config.py
diff options
context:
space:
mode:
authorPratyush Desai2023-05-03 20:13:41 +0530
committerPratyush Desai2023-05-03 20:13:41 +0530
commit43526c19a69cbea09e9c96b3420ab9613ada087c (patch)
tree8abf1f9f11d36f556a385a953cb5fda0057f0c0e /config.py
parentf6c9705fc5d4c70bbf4018bc562e117e34983c6c (diff)
downloadsnoparser-43526c19a69cbea09e9c96b3420ab9613ada087c.tar.gz
snoparser-43526c19a69cbea09e9c96b3420ab9613ada087c.tar.bz2
snoparser-43526c19a69cbea09e9c96b3420ab9613ada087c.zip
black formatting
Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
Diffstat (limited to 'config.py')
-rw-r--r--config.py232
1 files changed, 149 insertions, 83 deletions
diff --git a/config.py b/config.py
index 10df78b..14654c5 100644
--- a/config.py
+++ b/config.py
@@ -29,139 +29,205 @@
###
from supybot import conf, registry, ircutils
+
try:
from supybot.i18n import PluginInternationalization
- _ = PluginInternationalization('SnoParser')
+
+ _ = PluginInternationalization("SnoParser")
except:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
_ = lambda x: x
-#class ValidChannel(registry.string):
+# class ValidChannel(registry.string):
# """Value must be a valid channel"""
# def setValue(self, v):
# if not (ircutils.isChannel(v)):
# self.error()
# registry.String.setValue(self, v)
+
def configure(advanced):
# This will be called by supybot to configure this module. advanced is
# a bool that specifies whether the user identified themself as an advanced
# user or not. You should effect your configuration by manipulating the
# registry as appropriate.
from supybot.questions import expect, anything, something, yn
- conf.registerPlugin('SnoParser', True)
+
+ conf.registerPlugin("SnoParser", True)
-SnoParser = conf.registerPlugin('SnoParser')
+SnoParser = conf.registerPlugin("SnoParser")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(SnoParser, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
-#conf.registerNetworkValue(SnoParser, 'targetChannel', ValidChannel,
+# conf.registerNetworkValue(SnoParser, 'targetChannel', ValidChannel,
# ("", ("""Determines which channel the bot should send snolines""")))
-conf.registerNetworkValue(SnoParser, 'targetChannel',
- registry.String("", ("""Determines which channel the bot should snolines example: `#snotices`""")))
+conf.registerNetworkValue(
+ SnoParser,
+ "targetChannel",
+ registry.String(
+ "",
+ ("""Determines which channel the bot should snolines example: `#snotices`"""),
+ ),
+)
-conf.registerGlobalValue(SnoParser, 'AutoVhost',
- registry.String('libcasa/user/', ("""Configure the vhost eg. libcasa/user/$account""")))
+conf.registerGlobalValue(
+ SnoParser,
+ "AutoVhost",
+ registry.String(
+ "libcasa/user/", ("""Configure the vhost eg. libcasa/user/$account""")
+ ),
+)
-conf.registerGlobalValue(SnoParser, 'preventHighlight',
- registry.Boolean(True, ("""Toggles in channel highlights with ZWSP""")))
+conf.registerGlobalValue(
+ SnoParser,
+ "preventHighlight",
+ registry.Boolean(True, ("""Toggles in channel highlights with ZWSP""")),
+)
-conf.registerGlobalValue(SnoParser, 'debug',
- registry.Boolean('false',
- """
+conf.registerGlobalValue(
+ SnoParser,
+ "debug",
+ registry.Boolean(
+ "false",
+ """
SnoParser: Verbose output. Note: there is a seperate debug option for the `whois` client.
- """
- , private=True
-))
+ """,
+ private=True,
+ ),
+)
###
# REDIS related settings below:
###
-conf.registerGroup(SnoParser, 'redis')
-conf.registerGlobalValue(SnoParser.redis, 'db1',
- registry.Integer(1,
- """
+conf.registerGroup(SnoParser, "redis")
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "db1",
+ registry.Integer(
+ 1,
+ """
Redis: Database number for counting of NICKNAMES.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.redis, 'db2',
- registry.Integer(2,
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "db2",
+ registry.Integer(
+ 2,
+ """
Redis: Database number for counting of IP ADDRESSES.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.redis, 'host',
- registry.String('127.0.0.1',
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "host",
+ registry.String(
+ "127.0.0.1",
+ """
Redis: IP address or hostname.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.redis, 'port',
- registry.Integer(6379,
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "port",
+ registry.Integer(
+ 6379,
+ """
Redis: Port.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.redis, 'username',
- registry.String('',
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "username",
+ registry.String(
+ "",
+ """
Redis: Username. This is optional and has not been tested. It is recommended to perform initial tests on a local instance with no username and password.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.redis, 'password',
- registry.String('',
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "password",
+ registry.String(
+ "",
+ """
Redis: Password. This is optional and has not been tested. It is recommended to perform initial tests on a local instance with no username and password.
- """
-))
-conf.registerGlobalValue(SnoParser.redis, 'timeout',
- registry.Integer(5,
- """
+ """,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis,
+ "timeout",
+ registry.Integer(
+ 5,
+ """
Redis: Socket Timeout. The developer does not know what to recommend here, but `5` seems to yield good results.
- """
-))
+ """,
+ ),
+)
###
## WHOIS related settings below:
###
-conf.registerGroup(SnoParser, 'whois')
-conf.registerGlobalValue(SnoParser.whois, 'debug',
- registry.Boolean('false',
- """
+conf.registerGroup(SnoParser, "whois")
+conf.registerGlobalValue(
+ SnoParser.whois,
+ "debug",
+ registry.Boolean(
+ "false",
+ """
SnoParser: True: Very verbose console output. False: Mostly silent operation.
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.whois, 'sample',
- registry.String('',
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.whois,
+ "sample",
+ registry.String(
+ "",
+ """
SnoParser: This allows to set a testing IP address, if the plugin shall be evaluated on i.e. a local network. This will override all IP addresses from SNOTICES!
- """
- , private=True
-))
-conf.registerGlobalValue(SnoParser.whois, 'ttl',
- registry.Integer(3600,
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.whois,
+ "ttl",
+ registry.Integer(
+ 3600,
+ """
SnoParser: How long to cache WHOIS entries for.
- """
- , private=True
-))
-conf.registerGroup(SnoParser.whois, 'redis')
-conf.registerGlobalValue(SnoParser.whois.redis, 'db',
- registry.Integer(0,
- """
+ """,
+ private=True,
+ ),
+)
+conf.registerGroup(SnoParser.whois, "redis")
+conf.registerGlobalValue(
+ SnoParser.whois.redis,
+ "db",
+ registry.Integer(
+ 0,
+ """
Redis: Database number for WHOIS query caching.
- """
-))
+ """,
+ ),
+)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: