-
Notifications
You must be signed in to change notification settings - Fork 2
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
Configuration system #4
Comments
I would like to work on this, it would be based on the work done by arl on discord-modmail/modmail#75, where one could write configuration classes using marshmallow and attrs. This would support auto-generation of docs in the config file. Example: @attr.s(auto_attribs=True, slots=True)
class TwitterAuthCfg:
"""Twitter account authentication configuration."""
api_key: str = attr.ib(
default="",
on_setattr=attr.setters.frozen,
repr=False,
metadata={
"required": True,
"allow_none": False,
METADATA_TABLE: ConfigMetadata(
description="Think of this as the user name that represents your account when using the app.",
),
},
)
api_secret: str = attr.ib(
default="",
on_setattr=attr.setters.frozen,
repr=False,
metadata={
"required": True,
"allow_none": False,
METADATA_TABLE: ConfigMetadata(
description="Think of this as the password that represents your account when using the app.",
),
},
) Would auto-generate: [auth]
# Think of this as the user name that represents your account when using the app.
api_key = ""
# Think of this as the password that represents your account when using the app.
api_secret = "" |
So how would this work, a default configuration is generated with lots of empty keys? I'd prefer that the configuration file only contain keys that need to be used. |
Yes, it would only include the config keys which are required, and possibly I could add a separate flag if the user wants to generate with "all" of the keys. |
That sounds good. So:
|
Should be closed by #6 |
The user needs to be able to set options within a
sirius.config.toml
file. This will be implemented usingtomli
The text was updated successfully, but these errors were encountered: