__init__.py 683 B

12345678910111213141516171819202122232425262728
  1. import pathlib
  2. import pkg_resources
  3. from mopidy import config, ext
  4. __version__ = pkg_resources.get_distribution("Mopidy-Webhooks").version
  5. class Extension(ext.Extension):
  6. dist_name = "Mopidy-Webhooks"
  7. ext_name = "webhooks"
  8. version = __version__
  9. def get_default_config(self):
  10. return config.read(pathlib.Path(__file__).parent / "ext.conf")
  11. def get_config_schema(self):
  12. schema = super().get_config_schema()
  13. schema["url"] = config.String()
  14. schema["token"] = config.Secret()
  15. return schema
  16. def setup(self, registry):
  17. from .frontend import WebhooksFrontend
  18. registry.add("frontend", WebhooksFrontend)