def __init__(self, use_unicode=False): self.__host = self.config.get("mpd", "host") self.__port = self.config.get("mpd", "port") self.__timeout = 10 #MPDClient.__init__(self, *a, **k) MPDClient.__init__(self, use_unicode=use_unicode) self.use_unicode = use_unicode self._lock = Lock()
def __init__(self, host, port, password, datadir=None): MPDClient.__init__(self) if not self.connection(host, port, password): self.disconnect() raise NameError("Mauvais hôte ou mot de passe MPD") if not datadir: self.datadir = None else: self.datadir = datadir
def __init__(self, use_unicode=False): self.__host = self.config.get("mpd","host") self.__port = self.config.get("mpd","port") self.__timeout = 10 #MPDClient.__init__(self, *a, **k) MPDClient.__init__(self,use_unicode = use_unicode) self.use_unicode = use_unicode self._lock = Lock()
def __init__(self): self._cache = {} MPDClientBase.__init__(self) if hasattr(MPDClientBase, '_writecommand'): self._commands.update({'rescan': self._getitem ,'single': self._getnone ,'consume': self._getnone ,'idle': self._getlist ,'noidle': None })
def __init__(self, host, port, password, datadir=None): self.token = threading.Lock() MPDClient.__init__(self) if not self.connection(host, port, password): self.disconnect() raise NameError("Mauvais hôte ou mot de passe MPD") if not datadir: self.datadir = None else: self.datadir = datadir
def __init__(self, host, port, password): MPDClient.__init__(self) try: self.connect(host=host, port=port) except __import__("socket").gaierror: print("Couldn't connect to {0}:{1}".format(host, port)) exit(1) except __import__("socket").error: print("Couldn't connect using port {0}, but there seems to be a server at that IP.".format(port)) exit(1) if password: try: self.password(password) except CommandError: exit(1) print("Connected to {0}:{1}".format(host, port))
def __init__(self, conf): MPDClient.__init__(self) self._config = conf