9 from plugin
import GetPlugin
13 port
= config
.getPort()
15 httpd
= httpserver
.TivoHTTPServer(('', int(port
)), httpserver
.TivoHTTPHandler
)
17 for section
, settings
in config
.getShares():
18 httpd
.add_container(section
, settings
)
19 # Precaching of files: does a recursive list of base path
20 if settings
.get('precache', 'False').lower() == 'true':
21 plugin
= GetPlugin(settings
.get('type'))
22 if hasattr(plugin
, 'pre_cache'):
23 print 'Pre-caching the', section
, 'share.'
24 pre_cache_filter
= getattr(plugin
, 'pre_cache')
26 def build_recursive_list(path
):
28 for f
in os
.listdir(path
):
29 f
= os
.path
.join(path
, f
)
31 build_recursive_list(f
)
37 build_recursive_list(settings
.get('path'))
40 b
.add_service('TiVoMediaServer:%s/http' % port
)
42 if 'listen' in config
.getBeaconAddresses():
45 logging
.getLogger('pyTivo').info('pyTivo is ready.')
50 except KeyboardInterrupt: