8 from plugin
import GetPlugin
12 port
= config
.getPort()
14 httpd
= httpserver
.TivoHTTPServer(('', int(port
)), httpserver
.TivoHTTPHandler
)
16 for section
, settings
in config
.getShares():
17 httpd
.add_container(section
, settings
)
18 # Precaching of files: does a recursive list of base path
19 if settings
.get('precache', 'False').lower() == 'true':
20 plugin
= GetPlugin(settings
.get('type'))
21 if hasattr(plugin
, 'pre_cache'):
22 print 'Pre-caching the', section
, 'share.'
23 pre_cache_filter
= getattr(plugin
, 'pre_cache')
25 def build_recursive_list(path
):
27 for f
in os
.listdir(path
):
28 f
= os
.path
.join(path
, f
)
30 build_recursive_list(f
)
36 build_recursive_list(settings
.get('path'))
39 b
.add_service('TiVoMediaServer:' + str(port
) + '/http')
41 if 'listen' in config
.getBeaconAddresses():
44 logging
.getLogger('pyTivo').info('pyTivo is ready.')
49 except KeyboardInterrupt: