__init__.py 991 B

123456789101112131415161718192021222324252627282930313233343536
  1. from __future__ import unicode_literals
  2. import logging
  3. import os
  4. from mopidy import config, ext
  5. from .touch_screen import TouchScreen
  6. from .touch_screen_backend import TouchScreenBackend
  7. __version__ = '0.1.0'
  8. # TODO: If you need to log, use loggers named after the current Python module
  9. logger = logging.getLogger(__name__)
  10. class Extension(ext.Extension):
  11. dist_name = 'Mopidy-Touchscreen'
  12. ext_name = 'touchscreen'
  13. version = __version__
  14. def get_default_config(self):
  15. conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
  16. return config.read(conf_file)
  17. def get_config_schema(self):
  18. schema = super(Extension, self).get_config_schema()
  19. schema['screen_width'] = config.Integer()
  20. schema['screen_height'] = config.Integer()
  21. schema['cursor'] = config.Boolean()
  22. return schema
  23. def setup(self, registry):
  24. registry.add('frontend', TouchScreen)
  25. registry.add('backend', TouchScreenBackend)