コード例 #1
0
ファイル: mpd.py プロジェクト: oleastre/lollypop
 def __init__(self, eth, port=6600):
     """
         Init server
         @param eth as string
         @param port as int
     """
     self.event = None
     self.mpddb = MpdDatabase()
     self.playlist = {}
     self.playlist_version = 0
     self.idle_wanted_strings = []
     self.idle_strings = []
     try:
         # Set initial playlist version
         self.playlist[self.playlist_version] = []
         for track_id in Lp().playlists.get_tracks_ids(Type.MPD):
             self.playlist[
                     self.playlist_version].append(track_id)
         socketserver.TCPServer.allow_reuse_address = True
         # Get ip for interface
         ip = ""
         if eth != "":
             ip = get_ip(eth)
         socketserver.TCPServer.__init__(self, (ip, port), MpdHandler)
     except Exception as e:
         print("MpdServer::__init__(): %s" % e)
コード例 #2
0
 def __init__(self, eth, port=6600):
     """
         Init server
         @param eth as string
         @param port as int
     """
     self.event = None
     self.mpddb = MpdDatabase()
     self.playlist = {}
     self.playlist_version = 0
     self.idle_wanted_strings = []
     self.idle_strings = []
     try:
         # Set initial playlist version
         self.playlist[self.playlist_version] = []
         for track_id in Lp().playlists.get_tracks_ids(Type.MPD):
             self.playlist[self.playlist_version].append(track_id)
         socketserver.TCPServer.allow_reuse_address = True
         # Get ip for interface
         ip = ""
         if eth != "":
             ip = get_ip(eth)
         socketserver.TCPServer.__init__(self, (ip, port), MpdHandler)
     except Exception as e:
         print("MpdServer::__init__(): %s" % e)