def __init__(self, server, **kwargs): Backend.__init__(self, server, **kwargs) self.name = kwargs.get('name', 'Elisa') self.host = kwargs.get('host', '127.0.0.1') self.urlbase = kwargs.get('urlbase', '') ignore_patterns = kwargs.get('ignore_patterns', []) if self.urlbase[len(self.urlbase) - 1] != '/': self.urlbase += '/' self.server = server self.update_id = 0 self.root_id = 0 self.store = {} self.get_root_id()
def __init__(self, server, **kwargs): Backend.__init__(self, server, **kwargs) self.next_id = 1000 self.config = kwargs self.name = kwargs.get('name', 'LastFMStore') self.update_id = 0 self.store = {} self.server = server self.urlbase = 'http://ws.audioscrobbler.com/2.0/' self.wmc_mapping = {'4': 1000} self.init_completed = True
def __init__(self, server, **kwargs): Backend.__init__(self, server, **kwargs) self.next_id = 1000 self.config = kwargs self.name = kwargs.get('name', 'Buzztard') self.urlbase = kwargs.get('urlbase', '') if (len(self.urlbase) > 0 and self.urlbase[len(self.urlbase) - 1] != '/'): self.urlbase += '/' self.host = kwargs.get('host', '127.0.0.1') self.port = int(kwargs.get('port', 7654)) self.server = server self.update_id = 0 self.store = {} self.parent = None self.buzztard = BzConnection(backend=self, host=self.host, port=self.port)
def __init__(self, server, **kwargs): Backend.__init__(self, server, **kwargs) self.name = kwargs.get('name', 'Elisa MediaRenderer') self.host = kwargs.get('host', '127.0.0.1') self.player = None self.metadata = None if self.host == 'internal': try: from elisa.core import common self.player = common.get_application().get_player() self.init_completed = True except ImportError: self.warning('this works only from within Elisa') raise ImportError else: factory = pb.PBClientFactory() factory.noisy = False reactor.connectTCP(self.host, 8789, factory) d = factory.getRootObject() def result(player): self.player = player self.init_completed = True def got_error(error): self.warning('connection to Elisa failed!') self.on_init_failed(msg=error) d.addCallback(lambda object: object.callRemote('get_player')) d.addCallback(result) d.addErrback(got_error) self.playing = False self.state = None self.duration = None self.view = [] self.tags = {} self.poll_LC = LoopingCall(self.poll_player)