]> kaliko git repositories - mpd-goodies.git/blobdiff - lib/mpdclass.py
* [mfade] convert mfade to use the new framework
[mpd-goodies.git] / lib / mpdclass.py
index 40765fb204d359cf12d1f86f8105325e5124bc84..63a2f06d3a87355bd59ae63f7b1ab245717f0634 100755 (executable)
@@ -11,28 +11,6 @@ except ImportError, err:
     sys.exit(1)
 
 
-def get_mpd_environ():#{{{
-    """
-    Retrieve MPD env. var.
-    """
-    con_id = dict({'host': 'localhost',
-                   'port': int(6600)})
-    passwd = None
-    mpd_host_env = environ.get('MPD_HOST')
-    if mpd_host_env:
-        # If password is set:
-        # mpd_host_env = ['pass', 'host'] because MPD_HOST=pass@host
-        mpd_host_env = mpd_host_env.split('@')
-        mpd_host_env.reverse()
-        con_id.update({'host': mpd_host_env[0]})
-        if len(mpd_host_env) > 1:
-            print 'passwd set in MPD_HOST'
-            passwd = mpd_host_env[1]
-
-    con_id.update({'port': int(environ.get('MPD_PORT', con_id.get('port')))})
-    return (con_id, passwd)#}}}
-
-
 class MPDClass(object):
     """Connect to MPD server
     """
@@ -40,10 +18,11 @@ class MPDClass(object):
     def __init__(self):
         self.client = MPDClient()
 
-    def mpdConnect(self, con_id):#{{{
+    def mpdConnect(self):#{{{
         """
         Simple wrapper to connect MPD.
         """
+        con_id = dict({'host':self.cli_options.host, 'port':self.cli_options.port})
         try:
             self.client.connect(**con_id)
         except SocketError:
@@ -58,9 +37,6 @@ class MPDClass(object):
             return False
         return True#}}}
 
-    def connect(self):
-        """Connect & auth"""
-        pass
 
 def main():
     pass