pyTivo
[pyTivo/krkeegan.git] / pyTivo.py
blobf04a162e3e0cb8d795fc78a94c5f4bb0b081fd20
1 #!/usr/bin/env python2.4
4 import beacon, httpserver, os, sys
6 from Config import config
8 port = config.get('Server', 'Port')
10 httpd = httpserver.TivoHTTPServer(('', int(port)), httpserver.TivoHTTPHandler)
12 for section in config.sections():
13 if not section == 'Server':
14 httpd.add_container(section, config.get(section, 'type'), config.get(section, 'path'))
16 b = beacon.Beacon()
17 b.add_service('TiVoMediaServer:' + str(port) + '/http')
18 b.start()
20 try:
21 httpd.serve_forever()
22 except KeyboardInterrupt:
23 b.stop()