|
|
@@ -104,7 +104,16 @@ class RootDevice(static.Data): |
|
|
|
root = WebServer() |
|
|
|
debug.insertnamespace('root', root) |
|
|
|
content = resource.Resource() |
|
|
|
cds = ContentDirectoryServer('My Media Server', klass = FSDirectory, path = 'media', urlbase = os.path.join(urlbase, 'content'), webbase = content) # This sets up the root to be the media dir so we don't have to enumerate the directory |
|
|
|
mediapath = 'media' |
|
|
|
if not os.path.isdir(mediapath): |
|
|
|
print >>sys.stderr, \ |
|
|
|
'Sorry, %s is not a directory, no content to serve.' % `mediapath` |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
# This sets up the root to be the media dir so we don't have to |
|
|
|
# enumerate the directory |
|
|
|
cds = ContentDirectoryServer('My Media Server', klass=FSDirectory, |
|
|
|
path=mediapath, urlbase=os.path.join(urlbase, 'content'), webbase=content) |
|
|
|
debug.insertnamespace('cds', cds) |
|
|
|
root.putChild('ContentDirectory', cds) |
|
|
|
cds = cds.control |
|
|
|