def load_producer_sim(importname, base_class_type, *args, **kargs): # search under all producer simulation paths for module with the name importname; return first occurence # Try to find converter in given sim producer paths for producer_sim_path in settings.get_producer_sim_path(): # Loop over all paths try: return _factory(importname, base_class_type, producer_sim_path, *args, **kargs) except IOError: # Module not found in actual path pass raise RuntimeError('Producer simulation %s in paths %s not found!', importname, settings.get_producer_sim_path())
def load_producer_sim( importname, base_class_type, *args, **kargs ): # search under all producer simulation paths for module with the name importname; return first occurence # Try to find converter in given sim producer paths for producer_sim_path in settings.get_producer_sim_path( ): # Loop over all paths try: return _factory(importname, base_class_type, producer_sim_path, *args, **kargs) except IOError: # Module not found in actual path pass raise RuntimeError('Producer simulation %s in paths %s not found!', importname, settings.get_producer_sim_path())
def test_entities_settings(self): settings.add_converter_path(r'C:\\test\\converter\\path') settings.add_receiver_path(r'/home/receiver/path') settings.add_producer_sim_path(r'test/producer_sim/path') self.assertTrue(r'C:\\test\\converter\\path' in settings.get_converter_path()) self.assertTrue(r'/home/receiver/path' in settings.get_receiver_path()) self.assertTrue(r'test/producer_sim/path' in settings.get_producer_sim_path()) settings.delete_converter_path(r'C:\\test\\converter\\path') settings.delete_receiver_path(r'/home/receiver/path') settings.delete_producer_sim_path(r'test/producer_sim/path') self.assertFalse(r'C:\\test\\converter\\path' in settings.get_converter_path()) self.assertFalse(r'/home/receiver/path' in settings.get_receiver_path()) self.assertFalse(r'test/producer_sim/path' in settings.get_producer_sim_path())
def test_entities_settings(self): settings.add_converter_path(r'C:\\test\\converter\\path') settings.add_receiver_path(r'/home/receiver/path') settings.add_producer_sim_path(r'test/producer_sim/path') self.assertTrue( r'C:\\test\\converter\\path' in settings.get_converter_path()) self.assertTrue(r'/home/receiver/path' in settings.get_receiver_path()) self.assertTrue( r'test/producer_sim/path' in settings.get_producer_sim_path()) settings.delete_converter_path(r'C:\\test\\converter\\path') settings.delete_receiver_path(r'/home/receiver/path') settings.delete_producer_sim_path(r'test/producer_sim/path') self.assertFalse( r'C:\\test\\converter\\path' in settings.get_converter_path()) self.assertFalse( r'/home/receiver/path' in settings.get_receiver_path()) self.assertFalse( r'test/producer_sim/path' in settings.get_producer_sim_path())