-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config section type with static attributes (especially for core) #708
Comments
Maybe replace the current config parser with custom code that reads a
structure from xml or markdown stored with the bot, then populates it with
data from a separate config file?
This would also have the added benefit of being able to throw an error if
you misspell the name of a config option or forget to set a required one.
The only issue might be the simplicity of adding additional modules, but
that could potentially be solved with the regular unix workaround of a *.d
file
|
XML is not the solution here. Or anywhere, really. This can easily be built on top of the existing paradigm. My current plan is for "well-defined" config sections to be made as classes, the attributes of which use Python's descriptors to assert that their data is well-formed while interfacing with the same ConfigParser we know and love. Simple, Pythonic, and (most importantly to the issue at hand) able to be documented entirely with docstrings meaning they'll stay in sync every release the same way the API docs do, through sphinx. |
Ok. I had seen this issue mentioned in another as though you still didn't
really know how you wanted to do this, and there were no comments on the
issue yet, so I thought i'd offer an idea and see where it went.
As that is not the case, is there anything else I could do to get this idea
off the ground?
|
Modules left to port to the new config stuff are:
|
regarding translate: drop the logging (kinda silly I named that thing "research needs"), drop collect lines. |
Radio could be dropped. We haven't used it in forever. |
Okay; both are done. I'll also be changing the auto accept invite in admin to true (people ask a lot), and deprecating wikipedia's |
Wizard is currently busted, and there needs to be a thing for sasl auth mechanism, but other than that this is done. |
We rarely remember to document core config options. One way to force ourselves to do so would be to create a special type for the core section which has a defined group of attributes and raises AttributeError on anything else. This way, any time we want to use a new config in the core section, we'd have to add it to that object, and thus document it. It might lead to a better way of documenting module configs, too (rather than markdown in their docstrings).
This should include reviewing how attributes are set with commands, to include appending and such.
The text was updated successfully, but these errors were encountered: