Example #1
0
    def validate_config(self, config):  # no_coverage
        if not config.getboolean("azure", "enabled"):
            return

        if not config.get("azure", "account_key"):
            raise ExtensionError("Azure account_key missing")

        if not config.get("azure", "account_name"):
            raise ExtensionError("Azure account_name missing")

        if not config.get("azure", "container"):
            raise ExtensionError("Azure container missing")
Example #2
0
 def validate_config(self, config):
     if not config.getboolean('soundcloud', 'enabled'):
         return
     if not config.get('soundcloud', 'auth_token'):
         raise ExtensionError("In order to use SoundCloud extension you\
          must provide auth_token, for more information referrer to \
          https://github.com/mopidy/mopidy-soundcloud/")
Example #3
0
def mopify_client_factory(config, core):
    directory = 'debug' if (config.get(__ext_name__)['debug']
                            == True) else 'min'
    mopifypath = os.path.join(os.path.dirname(__file__), 'static', directory)

    return [('/sync/(.*)', sync.RootRequestHandler, {
        'core': core,
        'config': config
    }),
            ('/queuemanager/(.*)', QueueManagerRequestHandler.RequestHandler, {
                'core': core,
                'config': config
            }),
            ('/localfiles/(.*)', LocalFilesRequestHandler.RequestHandler, {
                'core': core,
                'config': config
            }),
            ('/update', update.UpdateRequestHandler, {
                'core': core,
                'config': config
            }),
            (r'/(.*)', tornado.web.StaticFileHandler, {
                "path": mopifypath,
                "default_filename": "index.html"
            })]
Example #4
0
 def validate_config(self, config):  # no_coverage
     if not config.getboolean('soundcloud', 'enabled'):
         return
     if not config.get('soundcloud', 'auth_token'):
         raise ExtensionError(
             'In order to use SoundCloud extension you must provide an '
             'auth token. For more information refer to '
             'https://github.com/mopidy/mopidy-soundcloud/')
Example #5
0
 def validate_config(self, config):  # no_coverage
     if not config.getboolean('plex', 'enabled'):
         return
     if not config.get('plex', 'server'):
         raise exceptions.ExtensionError(
             'In order to use the Plex Music extension you must provide a '
             'server address. For more information refer to '
             'https://github.com/havardgulldahl/mopidy-plex/')
Example #6
0
 def validate_config(self, config):  # no_coverage
     if not config.getboolean('soundcloud', 'enabled'):
         return
     if not config.get('soundcloud', 'auth_token'):
         raise ExtensionError(
             'In order to use SoundCloud extension you must provide an '
             'auth token. For more information refer to '
             'https://github.com/mopidy/mopidy-soundcloud/')
Example #7
0
def spotmop_client_factory(config, core):

    # TODO create minified version of the project for production (or use Bower or Grunt for building??)
    environment = 'dev' if config.get(
        __ext_name__)['debug'] is True else 'prod'
    artworklocation = config.get(__ext_name__)['artworklocation']
    spotmoppath = os.path.join(os.path.dirname(__file__), 'static')

    # PUSHER: TODO: need to fire this up from within the PusherHandler class... somehow
    pusherport = str(config['spotmop']['pusherport'])
    application = tornado.web.Application([
        ('/pusher', pusher.PusherHandler, {
            'version': __version__
        }),
    ])
    application.listen(pusherport)

    logger.info('Pusher server running on []:' + str(pusherport))

    return [
        (r'/upgrade', upgrade.UpgradeRequestHandler, {
            'core': core,
            'config': config,
            'version': __version__
        }),
        (r'/pusher/([^/]+)', pusher.PusherRequestHandler, {
            'core': core,
            'config': config
        }),
        (r'/auth', auth.AuthRequestHandler, {
            'core': core,
            'config': config
        }),
        (r'/queuer/([^/]*)', queuer.QueuerRequestHandler, {
            'core': core,
            'config': config
        }),
        (r"/images/(.*)", tornado.web.StaticFileHandler, {
            "path": artworklocation
        }),
        (r'/(.*)', tornado.web.StaticFileHandler, {
            "path": spotmoppath,
            "default_filename": "index.html"
        }),
    ]
Example #8
0
 def validate_config(self, config):  # no_coverage
     if not config.getboolean("soundcloud", "enabled"):
         return
     if not config.get("soundcloud", "auth_token"):
         raise ExtensionError(
             "In order to use SoundCloud extension you must provide an "
             "auth token. For more information refer to "
             "https://github.com/mopidy/mopidy-soundcloud/"
         )
Example #9
0
def spotmop_client_factory(config, core):

	# TODO create minified version of the project for production (or use Bower or Grunt for building??)
    environment = 'dev' if config.get(__ext_name__)['debug'] is True else 'prod'
    artworklocation = config.get(__ext_name__)['artworklocation']
    spotmoppath = os.path.join( os.path.dirname(__file__), 'static')

    # PUSHER: TODO: need to fire this up from within the PusherHandler class... somehow
    pusherport = str(config['spotmop']['pusherport'])
    application = tornado.web.Application([
        ('/pusher', pusher.PusherHandler, {
                'version': __version__
            }),
    ])
    application.listen(pusherport)
    
    logger.info( 'Pusher server running on []:'+ str(pusherport) )
	
    return [
		(r'/upgrade', upgrade.UpgradeRequestHandler, {
				'core': core,
				'config': config,
				'version': __version__ 
			}),
		(r'/pusher/([^/]+)', pusher.PusherRequestHandler, {
				'core': core,
				'config': config
			}),
		(r'/auth', auth.AuthRequestHandler, {
				'core': core,
				'config': config
			}),
		(r'/queuer/([^/]*)', queuer.QueuerRequestHandler, {
				'core': core,
				'config': config
			}),
        (r"/images/(.*)", tornado.web.StaticFileHandler, {
            "path": artworklocation
        }),
        (r'/(.*)', tornado.web.StaticFileHandler, {
				"path": spotmoppath,
				"default_filename": "index.html"
			}),
    ]
Example #10
0
def mopify_client_factory(config, core):
    directory = 'debug' if (config.get(__ext_name__)['debug'] == True) else 'min'
    mopifypath = os.path.join(os.path.dirname(__file__), 'static', directory)

    return [
        ('/sync/(.*)', sync.RootRequestHandler, {'core': core, 'config': config}),
        ('/update', update.UpdateRequestHandler, {'core': core, 'config': config}),
        (r'/(.*)', tornado.web.StaticFileHandler, {
            "path": mopifypath,
            "default_filename": "index.html"
        })
    ]
Example #11
0
def mopify_client_factory(config, core):
    directory = "debug" if (config.get(__ext_name__)["debug"] == True) else "min"
    mopifypath = os.path.join(os.path.dirname(__file__), "static", directory)

    return [
        ("/sync/(.*)", sync.RootRequestHandler, {"core": core, "config": config}),
        (
            "/queuemanager/(.*)",
            requesthandler.RequestHandler,
            {"core": core, "config": config, "instance": mem.queuemanager},
        ),
        ("/update", update.UpdateRequestHandler, {"core": core, "config": config}),
        (r"/(.*)", tornado.web.StaticFileHandler, {"path": mopifypath, "default_filename": "index.html"}),
    ]
Example #12
0
 def initialize(self, core, config):
     self.config_file = config.get('websettings')['config_file']
     self.core = core
	def initialize(self, core, config):
		self.config_file = config.get('material-webclient')['config_file']
		self.core = core
Example #14
0
 def initialize(self, config):
     self.config_file = config.get('websettings')['config_file']
Example #15
0
 def initialize(self, core, config):
     self.config_file = config.get('material-webclient')['config_file']
     self.core = core