| Trees | Indices | Help |
|
|---|
|
|
1 # Moovida - Home multimedia server 2 # Copyright (C) 2006-2009 Fluendo Embedded S.L. (www.fluendo.com). 3 # All rights reserved. 4 # 5 # This file is available under one of two license agreements. 6 # 7 # This file is licensed under the GPL version 3. 8 # See "LICENSE.GPL" in the root of this distribution including a special 9 # exception to use Moovida with Fluendo's plugins. 10 # 11 # The GPL part of Moovida is also available under a commercial licensing 12 # agreement from Fluendo. 13 # See "LICENSE.Moovida" in the root directory of this distribution package 14 # for details on that license. 15 16 from elisa.extern.translation import Translator 17 18 from elisa.core import log, common 19 20 from elisa.core import config, plugin_registry 21 from elisa.core import interface_controller 22 from elisa.core import metadata_manager 23 from elisa.core import input_manager 24 from elisa.core import bus 25 from elisa.extern.log import log as extern_log 26 27 from twisted.trial import unittest 28 import os, sys, inspect 29 30 31 32 DEFAULT_CONFIG = """\ 33 [general] 34 version = '%(version)s' 35 install_date = '%(install_date)s' 36 metadata_providers = [] 37 service_providers = [] 38 39 [media_db:media_scanner] 40 enabled = '1' 41 fivemin_location_updates = [] 42 hourly_location_updates = [] 43 daily_location_updates = [] 44 weekly_location_updates = [] 45 unmonitored_locations = [] 46 47 [media_db:db] 48 db_backend = 'sqlite' 49 database = 'elisa.db' 50 51 [xmlmenu:locations_builder] 52 locations = [] 53 auto_locations = 1 54 55 [lirc:lirc_input] 56 # filename of the LIRC config map to use 57 lirc_rc = 'streamzap.lirc' 58 delay = '4' 59 repeat = '1' 60 61 [coherence:coherence_service] 62 logmode = 'none' 63 controlpoint = 'yes' 64 65 [[plugins]] 66 67 """ 68 697110173 #self.config = config.Config(config_file) 74 if not default_config: 75 default_config = DEFAULT_CONFIG 76 self.errors = [] 77 78 default_config = default_config % {'version': 'test', 79 'install_date': 'none'} 80 self.config = config.Config('empty.conf', default_config) 81 common.set_application(self) 82 83 self.translator = Translator() 84 manager = plugin_registry.PluginRegistry(self.config) 85 if load_all_plugins: 86 manager.load_plugins() 87 88 self.plugin_registry = manager 89 self.bus = bus.Bus() 90 self.metadata_manager = metadata_manager.MetadataManager() 91 self.input_manager = input_manager.InputManager() 92 self.interface_controller = interface_controller.InterfaceController() 93 self.interface_controller.initialize()94 98103 default_config = DEFAULT_CONFIG 104 load_all_plugins = False 105 tests_dir = os.path.dirname(__file__) 106141108 self._booted = False 109 110 test_file_path = inspect.getsourcefile(self.__class__) 111 if test_file_path is not None: 112 fname = os.path.basename(test_file_path) 113 114 fname, _ = os.path.splitext(fname) 115 self.logCategory = fname 116 self.directory = os.path.dirname(test_file_path) 117 118 #extern_log.init('ELISA_TESTS') 119 unittest.TestCase.__init__(self, methodName=methodName)120 121 debug = extern_log.Loggable.debug 122 info = extern_log.Loggable.info 123125 if self._booted == False: 126 if 'ELISA_DEBUG' not in os.environ: 127 log.setDebug('*:0') 128 129 app = BoilerPlateApp('empty.conf', self.default_config, 130 self.load_all_plugins) 131 self.debug("Set common.application to %r", app) 132 133 self._booted = True134 137
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Dec 1 10:55:47 2009 | http://epydoc.sourceforge.net |