changeset 315:ec44c6ddc8cf

music path changes
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 16 Jun 2006 16:59:30 +0000
parents 3a418fe9e5b1
children 9e4cd9704511
files light9/showconfig.py
diffstat 1 files changed, 8 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/light9/showconfig.py	Fri Jun 16 17:00:59 2006 +0000
+++ b/light9/showconfig.py	Fri Jun 16 16:59:30 2006 +0000
@@ -16,38 +16,21 @@
     return r
 
 def musicDir():
-    return path.join(root(),"music")
+    return path.join(root(),"music_local")
 
 def songInMpd(song):
 
     """mpd only works off its own musicroot, which for me is
     /my/music. song is a file in musicDir; this function returns a
     version starting with the mpd path, but minus the mpd root itself.
-    the mpc ~/.mpdconf """
-
-    assert isinstance(song, URIRef), "songInMpd now takes URIRefs"
-
-    mpdHome = None
-    for line in open(path.expanduser("~/.mpdconf")):
-        if line.startswith("music_directory"):
-            mpdHome = line.split()[1].strip('"')
-    if mpdHome is None:
-        raise ValueError("can't find music_directory in your ~/.mpdconf")
-    mpdHome = mpdHome.rstrip(path.sep) + path.sep
+    the mpc ~/.mpdconf
 
-    songFullPath = songOnDisk(song)
-    if not songFullPath.startswith(mpdHome):
-        raise ValueError("the song path %r is not under your MPD music_directory (%r)" % (songFullPath, mpdHome))
-        
-    mpdRelativePath = songFullPath[len(mpdHome):]
-    if path.join(mpdHome, mpdRelativePath) != songFullPath:
-        raise ValueError("%r + %r doesn't make the songpath %r" % (mpdHome, mpdRelativePath, songFullPath))
-    return mpdRelativePath.encode('ascii')
-
-def songOnDisk(song):
-    graph = getGraph()
-    songFullPath = path.join(root(), graph.value(song, L9['showPath']))
-    return songFullPath
+    changed root to /home/drewp/projects/light9/show/dance2005 for now
+    """
+    
+    if 'dance2005' in root():
+        return "projects/dance2005/%s" % song
+    raise NotImplementedError
 
 def curvesDir():
     return path.join(root(),"curves")