Skip to content

Commit

Permalink
calc: add config wizard handler and better setting docstring
Browse files Browse the repository at this point in the history
The docstring for `configure()` is currently used by the website build
process to auto-generate a page describing the core module settings. At
some point we'll figure out how to get away from that, but at present
it's a necessary hack to avoid manually maintaining that page.
  • Loading branch information
dgw committed Apr 23, 2019
1 parent 0d4fc85 commit e16ae1f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion sopel/modules/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,25 @@ def quote(s):
class CalcSection(StaticSection):
oblique_url = ValidatedAttribute('oblique_url',
default='https://tumbolia-sopel.appspot.com/')
"""Full URL of the Oblique service instance to use for Python evaluation"""
"""Full URL of the Oblique service instance to use
Called for Python evaluation, instead of running unrestricted user input in
the local interpreter.
The trailing slash is required.
"""


def configure(config):
"""
| name | example | purpose |
| ---- | ------- | ------- |
| oblique\\_url | https://tumbolia-sopel.appspot.com/ | URL to an [Oblique](https://github.com/sopel-irc/oblique) instance |
"""
config.define_section('calc', CalcSection)
config.calc.configure_setting('oblique_url',
"URL of an Oblique instance, including the "
"trailing slash:")


def setup(bot):
Expand Down

0 comments on commit e16ae1f

Please sign in to comment.