All pastes #958267 Raw Edit

Unnamed

public text v1 · immutable
#958267 ·published 2008-03-26 16:45 UTC
rendered paste body
#!/usr/bin/env python


import beacon, httpserver, os, sys

from Config import config
import Config

port = config.get('Server', 'Port')

httpd = httpserver.TivoHTTPServer(('', int(port)), httpserver.TivoHTTPHandler)

for section in Config.getShares():
    settings = {}
    settings.update(config.items(section))
    httpd.add_container(section, settings)

b = beacon.Beacon()
b.add_service('TiVoMediaServer:' + str(port) + '/http')
b.start()

try:
    httpd.serve_forever()
except KeyboardInterrupt:
    b.stop()