def __init__(self, connection): EventEmitter.__init__(self) self.register(self.CHANGE_EVENT) self.register(self.LOAD_EVENT) self.register(self.POSITION_EVENT) self.connection = connection self.current = None connection.listen(connection.CONNECT_EVENT, self._connected)
def __init__(self): """Create an unconnected connection represantation""" EventEmitter.__init__(self) self.connected = False self.xmms = None # create events self.register(self.CONNECT_EVENT) self.register(self.DISCONNECT_EVENT) # initialize modules self.player = Player(self) self.playlist = Playlist(self)
def __init__(self, connection): EventEmitter.__init__(self) self.connection = connection self._status = None # create events self.register(self.STATUS_EVENT) self.register(self.VOLUME_EVENT) self.register(self.CURRENT_EVENT) if connection.connected: self._connected() connection.listen(connection.CONNECT_EVENT, self._connected)
def __init__(self, xc, steps, data=None, parent=None): EventEmitter.__init__(self) self.xc = xc self.steps = steps self.data = data self.parent = parent self.register(self.MODIFY_EVENT) if parent: self.collection = _create_collection(data, parent.steps[0]['sort'], parent.collection) else: self.collection = coll.Universe() self.requested = False self.childs = None self.expanded = False self.is_leaf = len(self.steps) == 0