-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
84 lines (75 loc) · 1.96 KB
/
config.py
File metadata and controls
84 lines (75 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
###
# Copyright (c) 2026, Barry KW Suridge
# All rights reserved.
#
#
###
from supybot import conf, registry
try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization("LocalControl")
except Exception:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
def _(x):
return x
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.
conf.registerPlugin("LocalControl", True)
LocalControl = conf.registerPlugin("LocalControl")
conf.registerGlobalValue(
LocalControl,
"socketRequestLogging",
registry.Boolean(
True,
_("""Whether LocalControl writes one log line per socket request."""),
),
)
conf.registerGlobalValue(
LocalControl,
"socketRequestFullCommandLogging",
registry.Boolean(
False,
_(
"""Whether LocalControl logs full socket command text after redaction."""
),
),
)
conf.registerGlobalValue(
LocalControl,
"tcpListenerEnabled",
registry.Boolean(
False,
_("""Whether LocalControl also listens on TCP for local testing."""),
),
)
conf.registerGlobalValue(
LocalControl,
"tcpListenHost",
registry.String(
"127.0.0.1",
_("""Host address for the optional TCP listener."""),
),
)
conf.registerGlobalValue(
LocalControl,
"tcpListenPort",
registry.PositiveInteger(
8023,
_("""Port for the optional TCP listener."""),
),
)
conf.registerGlobalValue(
LocalControl,
"tcpAllowRemote",
registry.Boolean(
False,
_(
"""Whether the optional TCP listener may bind to non-loopback hosts."""
),
),
)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: