Commits

Guillermo Szeliga committed f93469e

- Tracking system is now non-blocking

Comments (0)

Files changed (13)

longtang/actors/logger/logger.py

 
 	def __init__(self, level, system_ref, unique_id):
 		actors.Actor.__init__(self, system_ref, unique_id)
-
-		self.__level=level
+		self.__level=level if level is not None else 'CRITICAL'
 
 	def pre_setup(self):
 

longtang/actors/supervisors/filepackaging/test/test_filepackaging.py

 															.termination_type(messages.FilePackagingFinished).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(filepackaging_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		filepackaging_actor.tell(messages.PerformFilePackaging(source_file, metadata, base_test_dir, tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('FILE_PACKAGING_DONE').is_empty(), is_(False),'Tracking events of type FILE_PACKAGING_DONE is empty')
 		assert_that(tracking_info.mediafile.destinationpath, is_(not_none()), 'Destination path of mediafile is empty')
 															.termination_type(messages.FilePackagingFailure).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(filepackaging_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		filepackaging_actor.tell(messages.PerformFilePackaging(source_file, metadata, base_test_dir, tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('FILE_COPY_FAILURE').is_empty(), is_(False),'Tracking events of type FILE_COPY_FAILED is empty')
 
 															.termination_type(messages.FilePackagingFailure).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(filepackaging_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		filepackaging_actor.tell(messages.PerformFilePackaging(source_file, metadata, '/', tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('FOLDER_CREATION_FAILURE').is_empty(), is_(False),'Tracking events of type FOLDER_CREATION_FAILED is empty')
 
 															.termination_type(messages.FilePackagingFailure).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(filepackaging_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		filepackaging_actor.tell(messages.PerformFilePackaging(source_file, metadata, '/', tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('FOLDER_CREATION_FAILURE').is_empty(), is_(False),'Tracking events of type FOLDER_CREATION_FAILED is empty')	
 

longtang/actors/supervisors/flowconductor/test/test_flowconductor.py

 															.termination_type(messages.MediaFileHasBeenProcessed).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(flowconductor_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file_with_id3tag)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file_with_id3tag)
 
 		flowconductor_actor.tell(messages.MediaFileAvailable(source_file_with_id3tag, tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.mediafile.destinationpath, is_(equal_to(full_file_path)),'Filepath information on received message is wrong')
 
 															.termination_type(messages.MediaFileProcessingFailed).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(flowconductor_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file_with_id3tag)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file_with_id3tag)
 
 		flowconductor_actor.tell(messages.MediaFileAvailable(source_file_with_id3tag, tracking_id))
 
 															.termination_type(messages.MediaFileProcessingFailed).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(flowconductor_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking('/dummy.mp3')
+		tracking_id = tracking_facade.ask_audio_tracking_id('/dummy.mp3')
 
 		flowconductor_actor.tell(messages.MediaFileAvailable('/dummy.mp3', tracking_id))
 
 															.termination_type(messages.MediaFileProcessingFailed).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(flowconductor_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file_with_id3tag)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file_with_id3tag)
 
 		flowconductor_actor.tell(messages.MediaFileAvailable(source_file_with_id3tag, tracking_id))
 

longtang/actors/supervisors/id3taghandler/test/test_id3taghandler.py

 															.termination_type(messages.FileMetadataAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 		#Tracking information
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_AVAILABLE').is_empty(), is_(False),'Tracking events of type METADATA_AVAILABLE is empty')
 
 															.termination_type(messages.FileMetadataAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_AVAILABLE').is_empty(), is_(False),'Tracking events of type METADATA_AVAILABLE is empty')		
 
 															.termination_type(messages.FileMetadataNotFullyAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 		assert_that(message.source_file(), is_(not_none()), 'Source file information is empty')
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_NOT_AVAILABLE_FAILURE').is_empty(), is_(False),'Tracking events of type METADATA_NOT_AVAILABLE is empty')		
 
 															.termination_type(messages.FileMetadataNotFullyAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 		assert_that(message.source_file(), is_(not_none()), 'Source file information is empty')
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_NOT_AVAILABLE_FAILURE').is_empty(), is_(False),'Tracking events of type METADATA_NOT_AVAILABLE is empty')
 
 															.termination_type(messages.FileMetadataCouldNotBeEvaluated).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 		assert_that(message.source_file(), is_(not_none()), 'Source file information is empty')
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_EVALUATION_FAILURE').is_empty(), is_(False),'Tracking events of type METADATA_EVALUATION_FAILED is empty')
 
 															.termination_type(messages.FileMetadataAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_AVAILABLE').is_empty(), is_(False),'Tracking events of type METADATA_AVAILABLE is empty')
 
 															.termination_type(messages.FileMetadataNotFullyAvailable).build()
 
 		tracking_facade = facade.MediaTrackingFacade.create_within(id3taghandler_actor.system())
-		tracking_id = tracking_facade.create_audio_tracking(source_file)
+		tracking_id = tracking_facade.ask_audio_tracking_id(source_file)
 
 		id3taghandler_actor.tell(messages.InspectFileMetadata(source_file, tracking_id))
 
 
 		assert_that(message.tracking(), is_(equal_to(tracking_id)), 'Tracking id does not match')
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('METADATA_NOT_AVAILABLE_FAILURE').is_empty(), is_(False),'Tracking events of type METADATA_NOT_AVAILABLE_FAILURE is empty')		

longtang/actors/supervisors/main/main.py

 import messages
 
 from longtang.actors import actors
+from longtang.actors.tracking import tracking, messages as tracking_messages
 from longtang.actors.tracking import tracking, facade
 from longtang.actors.inbound import filepoller, messages as fp_messages
 from longtang.actors.supervisors.flowconductor import flowconductor, factory, messages as fc_messages
 		self.__flowconductor_ref = self.context().with_factory(factory.FlowConductorSupervisorFactory(self.__config),'flowconductor-actor')
 
 		self.logger().info('Initializing tracking-actor...')
-		self.__tracking_facade = facade.MediaTrackingFacade.create_within(self.context())
+		self.__tracking_ref = facade.MediaTrackingFacade.create_within(self.context())
 
 	
-	#TODO Invertir la generacion de tracking id, en vez de que la genere el actor, hacemos que el facade
-	#lo haga y hacemos un tell en vez de un ask, y no perdemos el tracking
-
 	def receive(self, message):
 		if isinstance(message, messages.KickOffMediaProcessing):
 			self.__caller.append(self.sender())
 			self.__file_poller_ref.tell(fp_messages.StartPolling(self.__config.read_from), self.myself())
 
 		elif isinstance(message, fp_messages.CompressedAudioFileFound):
-			tracking_id, parent_tracking_id = facade.MediaTrackingFacade.from_context(self.context()).create_compressed_audio_tracking(message.filepath(), message.compressed_parent_filepath())
+			self.__tracking_ref.create_compressed_audio_tracking(message.filepath(), message.compressed_parent_filepath(), self.myself())
+
+		elif isinstance(message, fp_messages.AudioFileFound):
+			self.__tracking_ref.create_audio_tracking(message.filepath(), self.myself())
+
+		elif isinstance(message, tracking_messages.CompressedAudioFileTrackingEntryCreated):
+			tracking_id = message.tracking_id()
+			sourcepath = message.sourcepath()
+
 			self.__filecount[tracking_id] = None
 
 			self.add_to_file_counter()
 
-			self.logger().debug(u'Compressed audio file tracked. [path: {0}, parent: {1}, tracking_id: {2}]'.format(message.filepath(),\
-																												  message.compressed_parent_filepath(),\
+			self.logger().debug(u'Compressed audio file tracked. [path: {0}, parent: {1}, tracking_id: {2}]'.format(message.sourcepath(),\
+																												  message.parent_sourcepath(),\
 																												  tracking_id))
 
-			self.__flowconductor_ref.tell(fc_messages.MediaFileAvailable(message.filepath(), tracking_id), self.myself())
+			self.__flowconductor_ref.tell(fc_messages.MediaFileAvailable(message.sourcepath(), tracking_id), self.myself())
+
+		elif isinstance(message, tracking_messages.TrackingEntryCreated):
+			tracking_id = message.tracking_id()
+			sourcepath = message.sourcepath()
 
-		elif isinstance(message, fp_messages.AudioFileFound):
-			tracking_id = facade.MediaTrackingFacade.from_context(self.context()).create_audio_tracking(message.filepath())
 			self.__filecount[tracking_id] = None
 			self.add_to_file_counter()
 
-			self.logger().debug(u'Audio file tracked. [path: {0}, tracking_id: {1}]'.format(message.filepath(), tracking_id))
+			self.logger().debug(u'Audio file tracked. [path: {0}, tracking_id: {1}]'.format(sourcepath, tracking_id))
 
-			self.__flowconductor_ref.tell(fc_messages.MediaFileAvailable(message.filepath(), tracking_id), self.myself())
+			self.__flowconductor_ref.tell(fc_messages.MediaFileAvailable(sourcepath, tracking_id), self.myself())
 
 		elif isinstance(message, fp_messages.CompressedFileCouldNotBeOpened):
 
 			self.logger().debug(u'Compressed file {0} could not be inflated'.format(message.filepath()))
 
-			tracking_id=facade.MediaTrackingFacade.from_context(self.context()).create_compressed_file_tracking(message.filepath())
-			facade.MediaTrackingFacade.from_context(self.context()).notify_inflate_failure(tracking_id)
+			self.__tracking_ref.notify_inflate_failure(message.filepath())
 		
 		elif isinstance(message, fc_messages.MediaFileHasBeenProcessed):
 			self.terminate_if_done(message)
 
 		if self.__counter == 0:
 			self.logger().info('Terminating execution.....')
-			summary =  None #facade.MediaTrackingFacade.from_context(self.context()).retrieve_summary()
+			summary =  self.__tracking_ref.retrieve_summary()
 			self.__caller[0].tell(messages.MediaProcessingFinished(summary), self.myself())

longtang/actors/supervisors/main/test/test_main.py

 from longtang.actors.supervisors.flowconductor import flowconductor
 from longtang.actors.inbound import filepoller
 from longtang.actors import actorstestutils
-from longtang.system import system, exceptions
+from longtang.system import system, exceptions, properties
 from longtang.config import configuration
 from longtang.common import interactions
 from longtang.actors.media.id3tag import domain
 
 class TestMainActor(unittest.TestCase):
 
-	def setUp(cls):
-		global base_from_test_dir
-		global base_to_test_dir
+    def setUp(cls):
+        global base_from_test_dir
+        global base_to_test_dir
 
-		base_from_test_dir = actorstestutils.create_tmp_dir(suffix='maintest_from')
-		base_to_test_dir = actorstestutils.create_tmp_dir(suffix='maintest_to')
+        base_from_test_dir = actorstestutils.create_tmp_dir(suffix='maintest_from')
+        base_to_test_dir = actorstestutils.create_tmp_dir(suffix='maintest_to')
 
-	def tearDown(cls):
-		actorstestutils.remove_tmp_dir(base_from_test_dir) 
-		actorstestutils.remove_tmp_dir(base_to_test_dir)
+    def tearDown(cls):
+        actorstestutils.remove_tmp_dir(base_from_test_dir) 
+        actorstestutils.remove_tmp_dir(base_to_test_dir)
 
-	def test_creation(self):
+    def test_creation(self):
 
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
 
-		actor_system = system.ActorSystemFactory.create()
-		main_actor = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
-		
-		try:		
-			assert_that(actor_system.find_by_id('main-actor'), is_not(None), 'Main actor does not exist within system')
+        actor_system = system.ActorSystemFactory.create()
+        main_actor = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        
+        try:        
+            assert_that(actor_system.find_by_id('main-actor'), is_not(None), 'Main actor does not exist within system')
 
-			assert_that(actor_system.find_by_id('file-poller-actor'), is_not(None), 'File poller actor does not exist within system')
-			assert_that(actor_system.find_by_id('flowconductor-actor'), is_not(None), 'Flowconductor actor actor does not exist within system')
+            assert_that(actor_system.find_by_id('file-poller-actor'), is_not(None), 'File poller actor does not exist within system')
+            assert_that(actor_system.find_by_id('flowconductor-actor'), is_not(None), 'Flowconductor actor actor does not exist within system')
 
-			assert_that(actor_system.find_by_id('file-poller-actor').parent(), is_(equal_to(actor_system.find_by_id('main-actor'))),'Parent actor is not correctly assigned')
-			assert_that(actor_system.find_by_id('flowconductor-actor').parent(), is_(equal_to(actor_system.find_by_id('main-actor'))),'Parent actor is not correctly assigned')
+            assert_that(actor_system.find_by_id('file-poller-actor').parent(), is_(equal_to(actor_system.find_by_id('main-actor'))),'Parent actor is not correctly assigned')
+            assert_that(actor_system.find_by_id('flowconductor-actor').parent(), is_(equal_to(actor_system.find_by_id('main-actor'))),'Parent actor is not correctly assigned')
 
-			#assert_that(actor_system.find_by_id('file-poller-actor')._instance(), is_(instance_of(filepoller.FilePoller)), 'File poller actor is not of the right type')
-			#assert_that(actor_system.find_by_id('flowconductor-actor')._instance(), is_(instance_of(flowconductor.FlowConductorSupervisor)), 'Flow conductor actor is not of the right type')
+            #assert_that(actor_system.find_by_id('file-poller-actor')._instance(), is_(instance_of(filepoller.FilePoller)), 'File poller actor is not of the right type')
+            #assert_that(actor_system.find_by_id('flowconductor-actor')._instance(), is_(instance_of(flowconductor.FlowConductorSupervisor)), 'Flow conductor actor is not of the right type')
 
-		except exceptions.ActorNotFound as e:
-			self.fail(str(e))
+        except exceptions.ActorNotFound as e:
+            self.fail(str(e))
 
-		actor_system.shutdown()
+        actor_system.shutdown()
 
-	def test_single_file_processing_with_tags(self):
-		
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
+    def test_single_file_processing_with_tags(self):
+        
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
 
-		source_file_with_id3tag = actorstestutils.copy_to_tmp(source=os.path.join(data_dir, 'with_id3taginfo.mp3'),suffix='.tmp.mp3',dir=base_from_test_dir)
+        source_file_with_id3tag = actorstestutils.copy_to_tmp(source=os.path.join(data_dir, 'with_id3taginfo.mp3'),suffix='.tmp.mp3',dir=base_from_test_dir)
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing())		
+        interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing())     
 
-		full_dir_path=os.path.join(base_to_test_dir, 'Bon Jovi', 'New Jersey')
-		full_file_path=os.path.join(full_dir_path,'08 - Ride Cowboy Ride.mp3')
+        full_dir_path=os.path.join(base_to_test_dir, 'Bon Jovi', 'New Jersey')
+        full_file_path=os.path.join(full_dir_path,'08 - Ride Cowboy Ride.mp3')
 
-		assert_that(os.path.isdir(full_dir_path), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path), is_(equal_to(True)),'Media file in target path does not exist')
+        assert_that(os.path.isdir(full_dir_path), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path), is_(equal_to(True)),'Media file in target path does not exist')
 
-		#id3tag
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path)
+        #id3tag
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path)
 
-		assert_that(reader.artist(), is_(equal_to('Bon Jovi')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('Ride Cowboy Ride')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('New Jersey')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
+        assert_that(reader.artist(), is_(equal_to('Bon Jovi')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('Ride Cowboy Ride')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('New Jersey')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
 
-	def test_multiple_file_encoding_processing_with_tags(self):
-		
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data','multiple_encodings')
+        actor_system.shutdown()
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
+    def test_multiple_file_encoding_processing_with_tags(self):
+        
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data','multiple_encodings')
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
 
-		interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing())	
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		#TODO Check how to check filenames in japanese or spanish within a python file	
+        interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()) 
 
-	def test_multiple_file_processing_with_tags(self): 
-		
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple')
+        #TODO Check how to check filenames in japanese or spanish within a python file  
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
+        actor_system.shutdown()
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+    def test_multiple_file_processing_with_tags(self): 
+        
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple')
 
-		interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()) 
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
 
-		full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
-		full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
+        interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()) 
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
+        full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
+        full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
 
-		assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
+        assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
 
-		full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
-		full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
 
-		assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')			
+        assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
+        full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
+        full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
 
-		assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
+        assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')         
 
-		full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
-		full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
 
-		assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist')	
+        assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
+        full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
+        full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
 
-		assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
+        assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist') 
 
-	def test_multiple_file_processing_with_compressed_files(self):
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple_with_compressed')
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
+        assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        actor_system.shutdown()
 
-		summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary()
+    def test_multiple_file_processing_with_compressed_files(self):
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple_with_compressed')
 
-		assert_that(summary.audio().total(), is_(equal_to(3)), 'Number of files in the summary is wrong')
-		assert_that(summary.audio().successes().total(), is_(equal_to(3)), 'Number of summary successes is wrong')
-		assert_that(summary.audio().successes(False).total(), is_(equal_to(1)), 'Number of summary successes without compressed audio files is wrong')
-		assert_that(summary.audio().failures().total(), is_(equal_to(0)), 'Number of failures successes is wrong')
-		assert_that(summary.audio().failures(False).total(), is_(equal_to(0)), 'Number of failures successes without compressed audio files is wrong')
-		assert_that(summary.compressed().successes().total(), is_(equal_to(2)), 'Number of success uncompressed files is wrong')
-		assert_that(summary.compressed().failures().total(), is_(equal_to(0)), 'Number of failed uncompressed files is wrong')		
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
 
-		full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
-		full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
+        actor_system = system.ActorSystemFactory.create()
 
-		assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
+        summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary()
 
-		assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
+        assert_that(summary.audio().total(), is_(equal_to(3)), 'Number of files in the summary is wrong')
+        assert_that(summary.audio().successes().total(), is_(equal_to(3)), 'Number of summary successes is wrong')
+        assert_that(summary.audio().successes(False).total(), is_(equal_to(1)), 'Number of summary successes without compressed audio files is wrong')
+        assert_that(summary.audio().failures().total(), is_(equal_to(0)), 'Number of failures successes is wrong')
+        assert_that(summary.audio().failures(False).total(), is_(equal_to(0)), 'Number of failures successes without compressed audio files is wrong')
+        assert_that(summary.compressed().successes().total(), is_(equal_to(2)), 'Number of success uncompressed files is wrong')
+        assert_that(summary.compressed().failures().total(), is_(equal_to(0)), 'Number of failed uncompressed files is wrong')      
 
-		full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
-		full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
+        full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
+        full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
 
-		assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')			
+        assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
 
-		assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
+        assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
 
-		full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
-		full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
+        full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
+        full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
 
-		assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist')	
+        assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')         
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
 
-		assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
+        assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
 
-	def test_multiple_file_processing_with_compressed_files_and_single_compressed_failure(self):
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple_with_compressed_failure')
+        full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
+        full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
+        assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist') 
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
 
-		summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary()
+        assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
 
-		assert_that(summary.audio().total(), is_(equal_to(3)), 'Number of files in the summary is wrong')
-		assert_that(summary.audio().successes().total(), is_(equal_to(3)), 'Number of summary successes is wrong')
-		assert_that(summary.audio().successes(False).total(), is_(equal_to(1)), 'Number of summary successes without compressed audio files is wrong')
-		assert_that(summary.audio().failures().total(), is_(equal_to(0)), 'Number of failures successes is wrong')
-		assert_that(summary.audio().failures(False).total(), is_(equal_to(0)), 'Number of failures successes without compressed audio files is wrong')
-		assert_that(summary.compressed().successes().total(), is_(equal_to(2)), 'Number of success uncompressed files is wrong')
-		assert_that(summary.compressed().failures().total(), is_(equal_to(1)), 'Number of failed uncompressed files is wrong')	
+        actor_system.shutdown()
 
-		full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
-		full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
+    def test_multiple_file_processing_with_compressed_files_and_single_compressed_failure(self):
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple_with_compressed_failure')
 
-		assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
+        summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary()
 
-		full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
-		full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
+        assert_that(summary.audio().total(), is_(equal_to(3)), 'Number of files in the summary is wrong')
+        assert_that(summary.audio().successes().total(), is_(equal_to(3)), 'Number of summary successes is wrong')
+        assert_that(summary.audio().successes(False).total(), is_(equal_to(1)), 'Number of summary successes without compressed audio files is wrong')
+        assert_that(summary.audio().failures().total(), is_(equal_to(0)), 'Number of failures successes is wrong')
+        assert_that(summary.audio().failures(False).total(), is_(equal_to(0)), 'Number of failures successes without compressed audio files is wrong')
+        assert_that(summary.compressed().successes().total(), is_(equal_to(2)), 'Number of success uncompressed files is wrong')
+        assert_that(summary.compressed().failures().total(), is_(equal_to(1)), 'Number of failed uncompressed files is wrong')  
 
-		assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')			
+        full_dir_path_source1=os.path.join(base_to_test_dir, 'The Aristocrats', 'Boing, We\'ll Do It Live!')
+        full_file_path_source1=os.path.join(full_dir_path_source1,'08 - A Very Metal Introduction.mp3')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
+        assert_that(os.path.isdir(full_dir_path_source1), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source1), is_(equal_to(True)),'Media file in target path does not exist')
 
-		assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source1)
 
-		full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
-		full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
+        assert_that(reader.artist(), is_(equal_to('The Aristocrats')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('A Very Metal Introduction')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Boing, We\'ll Do It Live!')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('8')), 'id3tag content for track number does not match')
 
-		assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
-		assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist')	
+        full_dir_path_source2=os.path.join(base_to_test_dir, 'Carla Bruni', 'Quelqu\'un M\'a Dit')
+        full_file_path_source2=os.path.join(full_dir_path_source2,'02 - La Dernière Minute.mp3')
 
-		reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
+        assert_that(os.path.isdir(full_dir_path_source2), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source2), is_(equal_to(True)),'Media file in target path does not exist')         
 
-		assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
-		assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
-		assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
-		assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source2)
 
-	def test_summary_success(self):
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple')
+        assert_that(reader.artist(), is_(equal_to(u'Carla Bruni')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to(u'La Dernière Minute')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to(u'Quelqu\'un M\'a Dit')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('2')), 'id3tag content for track number does not match')
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
+        full_dir_path_source3=os.path.join(base_to_test_dir, 'Big Cock', 'Year Of The Cock')
+        full_file_path_source3=os.path.join(full_dir_path_source3,'13 - Thank You, Good Night.mp3')
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        assert_that(os.path.isdir(full_dir_path_source3), is_(equal_to(True)), 'Artist or album directory does not exist or full name is not right')
+        assert_that(os.path.isfile(full_file_path_source3), is_(equal_to(True)),'Media file in target path does not exist') 
 
-		summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary() 
+        reader = domain.ID3TagReaderFactory.createFromType(full_file_path_source3)
 
-		assert_that(summary.audio().total(), equal_to(3), 'Amount of processed files is wrong')
-		assert_that(summary.audio().failures().total(), equal_to(0), 'Amount of failed files is wrong')
-		assert_that(summary.audio().successes().total(), equal_to(3), 'Amount of successed files is wrong')
+        assert_that(reader.artist(), is_(equal_to('Big Cock')), 'id3tag content for artist does not match')
+        assert_that(reader.title(), is_(equal_to('Thank You, Good Night')), 'id3tag content for title does not match')
+        assert_that(reader.album(), is_(equal_to('Year Of The Cock')), 'id3tag content for album does not match')
+        assert_that(reader.track_number(), is_(equal_to('13')), 'id3tag content for track number does not match') 
 
-	def test_summary_failure(self):
+        actor_system.shutdown()
 
-		data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
+    def test_summary_success(self):
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data', 'multiple')
 
-		source_file_with_id3tag = actorstestutils.copy_to_tmp(source=os.path.join(data_dir, 'withouttaginfo.mp3'),suffix='.tmp.mp3',dir=base_from_test_dir)
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(data_dir).generate_at(base_to_test_dir).build()
 
-		config_builder = configuration.LongTangConfigurationBuilder()
-		config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
 
-		actor_system = system.ActorSystemFactory.create()
-		main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+        summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary() 
 
-		summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary() 
+        assert_that(summary.audio().total(), equal_to(3), 'Amount of processed files is wrong')
+        assert_that(summary.audio().failures().total(), equal_to(0), 'Amount of failed files is wrong')
+        assert_that(summary.audio().successes().total(), equal_to(3), 'Amount of successed files is wrong')
 
-		assert_that(summary.audio().total(), equal_to(1), 'Amount of processed files is wrong')
-		assert_that(summary.audio().failures().total(), equal_to(1), 'Amount of failed files is wrong')
-		assert_that(summary.audio().successes().total(), equal_to(0), 'Amount of successed files is wrong')
+        actor_system.shutdown()
+
+    def test_summary_failure(self):
+
+        data_dir = os.path.join(actorstestutils.current_dirpath(__file__), 'data')
+
+        source_file_with_id3tag = actorstestutils.copy_to_tmp(source=os.path.join(data_dir, 'withouttaginfo.mp3'),suffix='.tmp.mp3',dir=base_from_test_dir)
+
+        config_builder = configuration.LongTangConfigurationBuilder()
+        config = config_builder.read_from(base_from_test_dir).generate_at(base_to_test_dir).build()
+
+        actor_system = system.ActorSystemFactory.create()
+        main_ref = actor_system.with_factory(factory.MainSupervisorFactory(config),'main-actor')
+
+        summary = interactions.InteractionPatterns.ask(actor_system, main_ref, messages.KickOffMediaProcessing()).summary() 
+
+        assert_that(summary.audio().total(), equal_to(1), 'Amount of processed files is wrong')
+        assert_that(summary.audio().failures().total(), equal_to(1), 'Amount of failed files is wrong')
+        assert_that(summary.audio().successes().total(), equal_to(0), 'Amount of successed files is wrong')
+
+        actor_system.shutdown()
 
 if __name__ == '__main__':
-	unittest.main()    
+    unittest.main()    

longtang/actors/tracking/facade.py

 	@staticmethod
 	def create_within(system_ref):
 
-		system_ref_tmp = system_ref
+		actor_ref = system_ref.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		#Actors domain
-		if isinstance(system_ref, actor_domain.SystemRefWrapper):
-			system_ref_tmp = system_ref._system_ref()
-			actor_ref = system_ref.from_type(tracking.TrackingActor,'mediatracking-actor')
-		else:
-			actor_ref = system_ref_tmp.from_type(tracking.TrackingActor,'mediatracking-actor', None)
+		return MediaTrackingFacade(system_ref, actor_ref)
+
+	def tell(self, message, reply_to):
+		self.__actor_ref.tell(message, reply_to)
+
+	def create_audio_tracking(self, mediapath, reply_to):
+		self.__actor_ref.tell(messages.CreateTrackingEntry(mediapath), reply_to)
 
-		return MediaTrackingFacade(system_ref_tmp, actor_ref)
+	def ask_audio_tracking_id(self, mediapath):
+		response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateTrackingEntry(mediapath))
+		return response.tracking_id()
 
-	def create_audio_tracking(self, mediapath):
-		#response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateTrackingEntry(mediapath))
-		#return response.tracking_id()
-		pass
+	def create_compressed_audio_tracking(self, mediapath, parent_mediapath, reply_to):
+		self.__actor_ref.tell(messages.CreateCompressedAudioFileTrackingEntry(mediapath, parent_mediapath), reply_to)
 
-	def create_compressed_audio_tracking(self, mediapath, parent_mediapath):
-		# response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateCompressedAudioFileTrackingEntry(mediapath, parent_mediapath))
-		# return response.tracking_id(), response.parent_tracking_id()
-		pass
+	def ask_compressed_audio_tracking_id(self, mediapath, parent_mediapath):
+		response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateCompressedAudioFileTrackingEntry(mediapath, parent_mediapath))
+		return response.tracking_id(), response.parent_tracking_id()
 
-	def create_compressed_file_tracking(self, mediapath):
-		# response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateCompressedFileTrackingEntry(mediapath))
-		# return response.tracking_id()
-		pass
+	def ask_compressed_file_tracking_id(self, mediapath):
+		response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.CreateCompressedFileTrackingEntry(mediapath))
+		return response.tracking_id()
 
-	def lookup(self, tracking_id):
-		# response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.LookupTrackingEntry(tracking_id))
-		# return response.tracking_info()
-		pass
+	def ask_tracking_info(self, tracking_id):
+		response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.LookupTrackingEntry(tracking_id))
+		return response.tracking_info()
 
 	def notify(self, tracking_id, event):
 		self.__actor_ref.tell(messages.RegisterTrackingEvent(tracking_id,event), None)
 
-	def notify_inflate_failure(self, tracking_id):
-		self.__actor_ref.tell(messages.RegisterCompressedFileTrackingEvent(tracking_id,mt_events.FileCouldNotBeInflated()), None)
+	def notify_inflate_failure(self, filepath):
+		self.__actor_ref.tell(messages.TrackFileAndRegisterCompressedFileTrackingEvent(filepath,mt_events.FileCouldNotBeInflated()), None)
 
 	def retrieve_summary(self):
 		response = interactions.InteractionPatterns.ask(self.__system_ref,self.__actor_ref, messages.GenerateSummary())

longtang/actors/tracking/messages.py

 		return self.__parent_sourcepath
 
 class TrackingEntryCreated(messages.ActorMessage):
-	def __init__(self, tracking_id):
+	def __init__(self, tracking_id, sourcepath):
 		messages.ActorMessage.__init__(self)
 		self.__tracking_id = tracking_id
+		self.__sourcepath = sourcepath
 
 	def tracking_id(self):
 		return self.__tracking_id
 
+	def sourcepath(self):
+		return self.__sourcepath
+
 class CompressedFileTrackingEntryCreated(TrackingEntryCreated):
-	def __init__(self, tracking_id):
-		TrackingEntryCreated.__init__(self, tracking_id)		
+	def __init__(self, tracking_id, sourcepath):
+		TrackingEntryCreated.__init__(self, tracking_id, sourcepath)
 
 class CompressedAudioFileTrackingEntryCreated(TrackingEntryCreated):
-	def __init__(self, tracking_id, parent_tracking_id):
-		TrackingEntryCreated.__init__(self, tracking_id)
+	def __init__(self, tracking_id, parent_tracking_id, sourcepath, parent_sourcepath):
+		TrackingEntryCreated.__init__(self, tracking_id, sourcepath)
 
 		self.__parent_tracking_id=parent_tracking_id
+		self.__parent_sourcepath=parent_sourcepath
 
 	def parent_tracking_id(self):
 		return	self.__parent_tracking_id
 
+	def parent_sourcepath(self):
+		return self.__parent_sourcepath
+
 class LookupTrackingEntry(messages.ActorMessage):
 	def __init__(self, tracking_id):
 		messages.ActorMessage.__init__(self)
 	def tracking_event(self):
 		return self.__tracking_event
 
+class TrackFileAndRegisterCompressedFileTrackingEvent(messages.ActorMessage):
+	def __init__(self, sourcepath, tracking_event):
+		self.__sourcepath=sourcepath
+		self.__tracking_event=tracking_event
+
+	def sourcepath(self):
+		return self.__sourcepath
+
+	def tracking_event(self):
+		return self.__tracking_event		
+
 class RegisterCompressedFileTrackingEvent(RegisterTrackingEvent):
 	pass
 

longtang/actors/tracking/test/test_facade.py

 import gevent
 import unittest
 import os
+import time
 
 from hamcrest import *
-from longtang.system import system, domain as sys_domain
+from longtang.system import system
 from longtang.actors import actorstestutils
 from longtang.actors.tracking import facade, tracking
 from longtang.common.mediatracking import events as mt_events
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id = tracking_facade.create_audio_tracking('/dummy.mp3')
+		tracking_id = tracking_facade.ask_audio_tracking_id('/dummy.mp3')
 
 		assert_that(tracking_id, is_(not_none()),'Tracking identifier is empty')
 
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id, parent_tracking_id = tracking_facade.create_compressed_audio_tracking('/dummy.mp3', '/compressed.zip')
+		tracking_id, parent_tracking_id = tracking_facade.ask_compressed_audio_tracking_id('/dummy.mp3', '/compressed.zip')
 
 		assert_that(tracking_id, is_(not_none()),'Tracking identifier is empty')
 		assert_that(parent_tracking_id, is_(not_none()),'Parent tracking identifier is empty')
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id = tracking_facade.create_compressed_file_tracking('/compressed.zip')
+		tracking_id = tracking_facade.ask_compressed_file_tracking_id('/compressed.zip')
 
 		assert_that(tracking_id, is_(not_none()),'Tracking identifier is empty')
 
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id = tracking_facade.create_audio_tracking('/dummy.mp3')
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_id = tracking_facade.ask_audio_tracking_id('/dummy.mp3')
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info, is_(not_none()),'Tracking information is empty')
 		assert_that(tracking_info.mediafile.sourcepath, is_('/dummy.mp3'),'Tracking sourcepath information is not right')
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))		
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id = tracking_facade.create_audio_tracking('/dummy.mp3')
+		tracking_id = tracking_facade.ask_audio_tracking_id('/dummy.mp3')
 
 		event = mt_events.MediaFileTrackingEvent('NONALTERING', 'This is a non-altering event')
 
 		tracking_facade.notify(tracking_id, event)
 
-		tracking_info = tracking_facade.lookup(tracking_id)
+		tracking_info = tracking_facade.ask_tracking_info(tracking_id)
 
 		assert_that(tracking_info.tracking_events.of_type('NONALTERING').is_empty(), is_(False),'Tracking events of type NONALTERING are empty')
 		assert_that(tracking_info.tracking_events.of_type('NONALTERING').get(0), is_(not_none()),'Tracked events does not exist')
 		actor_system = system.ActorSystemFactory.create()
 		tracking_actor = actor_system.from_type(tracking.TrackingActor,'mediatracking-actor')
 
-		tracking_facade = facade.MediaTrackingFacade.from_system(sys_domain.SystemRef(actor_system))
+		tracking_facade = facade.MediaTrackingFacade.from_system(actor_system)
 
-		tracking_id = tracking_facade.create_compressed_file_tracking('/compressed.zip')
+		tracking_facade.notify_inflate_failure('/compressed.zip')
 
-		event = mt_events.FileCouldNotBeInflated()
+		time.sleep(2)
 
-		tracking_facade.notify_inflate_failure(tracking_id)
+		summary = tracking_facade.retrieve_summary()
 
-		tracking_info = tracking_facade.lookup(tracking_id)
-
-		assert_that(tracking_info.tracking_events.of_type(event.type()).is_empty(), is_(False),'Tracking events of type {0} are empty'.format(event.type()))
-		assert_that(tracking_info.tracking_events.of_type(event.type()).get(0), is_(not_none()),'Tracked event does not exist')
+		assert_that(summary.compressed().failures().total(), is_(equal_to(1)), 'Inflate failure notification has not been registered')

longtang/actors/tracking/test/test_tracking.py

 		assert_that(response, is_(not_none()),'Tracking identifier message is empty')
 		assert_that(response, is_(instance_of(messages.TrackingEntryCreated)),'Tracking response message is not of the right type')
 		assert_that(response.tracking_id(), is_(not_none()),'Tracking identifier is missing')
+		assert_that(response.sourcepath(), is_(not_none()),'Tracking source path is empty')
+		assert_that(response.sourcepath(), is_(equal_to('/dummy.mp3')),'Tracking source path is wrong')
 
 		actor_system.shutdown()
 
 		assert_that(response, is_(instance_of(messages.CompressedFileTrackingEntryCreated)),'Tracking response message is not of the right type')
 		assert_that(response.tracking_id(), is_(not_none()),'Tracking identifier is missing')
 		assert_that(response.tracking_id(), is_(has_length(greater_than(0))),'Tracking identifier is empty')
+		assert_that(response.sourcepath(), is_(not_none()),'Tracking source path is missing')
+		assert_that(response.sourcepath(), is_(equal_to('/dummy.zip')),'Tracking source path value is wrong')
 
 		actor_system.shutdown()
 
 		assert_that(response, is_(instance_of(messages.CompressedAudioFileTrackingEntryCreated)),'Tracking response message is not of the right type')
 		assert_that(response.tracking_id(), is_(not_none()),'Tracking identifier is missing')
 		assert_that(response.tracking_id(), is_(has_length(greater_than(0))),'Tracking identifier is empty')
+		assert_that(response.sourcepath(), is_(not_none()),'Compressed audio file source path is empty')
+		assert_that(response.sourcepath(), is_(equal_to('mymusic.mp3')),'Compressed audio file source path is wrong')
 		assert_that(response.parent_tracking_id(), is_(not_none()),'Tracking identifier is missing')
 		assert_that(response.parent_tracking_id(), is_(has_length(greater_than(0))),'Tracking identifier is empty')
+		assert_that(response.parent_sourcepath(), is_(not_none()),'Parent compressed source path is wrong')
+		assert_that(response.parent_sourcepath(), is_(equal_to('/dummy.zip')),'Parent compressed source path is wrong')
 
 		actor_system.shutdown()
 

longtang/actors/tracking/tracking.py

 	def receive(self, message):
 		if isinstance(message, messages.CreateCompressedFileTrackingEntry):
 
-			self.logger().info(u'Creating compressed file tracking entry for source path \'{0}\' .....'.format(message.sourcepath()))
+			trackingid = self._create_compressed_file_tracking(message)
 
-			descriptor = mediatracking.CompressedFileDescriptorBuilder().sourcepath(message.sourcepath()).build()
-			file_tracking = mediatracking.MediaFileTracking.create_from(descriptor)
-			trackingid = tg.MessageTrackingGenerator.generate(message)
-
-			self.__compressed_files_trackings[trackingid]=file_tracking
-
-			self.sender().tell(messages.CompressedFileTrackingEntryCreated(trackingid), self.myself())
+			self.sender().tell(messages.CompressedFileTrackingEntryCreated(trackingid, message.sourcepath()), self.myself())
 
 		elif isinstance(message, messages.CreateCompressedAudioFileTrackingEntry):
 			
 
 			self.logger().debug(u'Compressed audio file tracked under id {0}.....'.format(audiofile_trackingid))
 
-			self.sender().tell(messages.CompressedAudioFileTrackingEntryCreated(audiofile_trackingid, compressedfile_trackingid), self.myself())
+			self.sender().tell(messages.CompressedAudioFileTrackingEntryCreated(audiofile_trackingid, \
+																				compressedfile_trackingid, \
+																				message.sourcepath(), \
+																				message.parent_sourcepath()), \
+																				self.myself())
 
 		elif isinstance(message, messages.CreateTrackingEntry):
 			self.logger().info(u'Creating tracking entry for source path {0} .....'.format(message.sourcepath()))
 
 			self.__audio_trackings[trackingid]=file_tracking
 
-			self.sender().tell(messages.TrackingEntryCreated(trackingid), self.myself())
+			self.sender().tell(messages.TrackingEntryCreated(trackingid, message.sourcepath()), self.myself())
 
 		elif isinstance(message, messages.LookupTrackingEntry):
 			self.logger().info(u'Looking up tracking entry {0} .....'.format(message.tracking_id()))
 				if self.sender() is not None:
 					self.sender().tell(messages.TrackingEntryNotFound(message.tracking_id()), self.myself())
 
+		elif isinstance(message,messages.TrackFileAndRegisterCompressedFileTrackingEvent):
+			tracking_id = self._create_compressed_file_tracking(message)
+
+			self.myself().tell(messages.RegisterCompressedFileTrackingEvent(tracking_id, message.tracking_event()),None)
+
 		elif isinstance(message, messages.GenerateSummary):
 			self.sender().tell(messages.SummarySuccessfullyGenerated(summary.ActivitySummary.create(self.__audio_trackings, self.__compressed_files_trackings)), self.myself())			
 		else: 
-			self.notify_marooned_message(message)
+			self.notify_marooned_message(message)
+
+	def _create_compressed_file_tracking(self, message):
+
+		self.logger().info(u'Creating compressed file tracking entry for source path \'{0}\' .....'.format(message.sourcepath()))
+
+		descriptor = mediatracking.CompressedFileDescriptorBuilder().sourcepath(message.sourcepath()).build()
+		file_tracking = mediatracking.MediaFileTracking.create_from(descriptor)
+		tracking_id = tg.MessageTrackingGenerator.generate(message)
+
+		self.__compressed_files_trackings[tracking_id]=file_tracking
+
+		return tracking_id		

longtang/common/interactions.py

 
 		#TODO The name could be dynamic i think
 		#TODO WE should remove this actor from the registry
-		host_actor = system_ref.with_factory(HostActorFactory(port),'int-act-' + str(uuid.uuid4()), None)
+		host_actor = system_ref.with_factory(HostActorFactory(port),'int-act-' + str(uuid.uuid4()))
 		actor_ref.tell(message,host_actor)
 
 		try:

longtang/system/syslogger.py

 class SystemLogger:
 	def __init__(self, system_ref, level):
 		#FIXME I'm always running the logger whether the level is None or not, maybe I could save a thread by not running it
-		self.__logger_actor_ref = system_ref.with_factory(factory.LoggerActorFactory(level),'sys-logger', domain.ROOT_PARENT)
-		print 'TODO ==> Evitar que se envien trazas cuando el nivel es None!!! ' + level
 		self.__level=level
+		self.__logger_actor_ref = system_ref.with_factory(factory.LoggerActorFactory(level),'sys-logger', domain.ROOT_PARENT)
 
 	def info(self, actor_id, message, source_file):
 		if self.__level is not None and actor_id != self.__get_lazy_logger().unique_id():