def _create_task(
            self,
            task_info,
            config_string,
            sync_map_root_directory,
            job_os_hierarchy_type
    ):
        """
        Create a task object from

        1. the ``task_info`` found analyzing the container entries, and
        2. the given ``config_string``.

        :param list task_info: the task information: ``[prefix, text_path, audio_path]``
        :param string config_string: the configuration string
        :param string sync_map_root_directory: the root directory for the sync map files
        :param job_os_hierarchy_type: type of job output hierarchy
        :type  job_os_hierarchy_type: :class:`~aeneas.hierarchytype.HierarchyType`
        :rtype: :class:`~aeneas.task.Task`
        """
        self.log(u"Converting config string to config dict")
        parameters = gf.config_string_to_dict(config_string)
        self.log(u"Creating task")
        task = Task(config_string, logger=self.logger)
        task.configuration["description"] = "Task %s" % task_info[0]
        self.log([u"Task description: %s", task.configuration["description"]])
        try:
            task.configuration["language"] = parameters[gc.PPN_TASK_LANGUAGE]
            self.log([u"Set language from task: '%s'", task.configuration["language"]])
        except KeyError:
            task.configuration["language"] = parameters[gc.PPN_JOB_LANGUAGE]
            self.log([u"Set language from job: '%s'", task.configuration["language"]])
        custom_id = task_info[0]
        task.configuration["custom_id"] = custom_id
        self.log([u"Task custom_id: %s", task.configuration["custom_id"]])
        task.text_file_path = task_info[1]
        self.log([u"Task text file path: %s", task.text_file_path])
        task.audio_file_path = task_info[2]
        self.log([u"Task audio file path: %s", task.audio_file_path])
        task.sync_map_file_path = self._compute_sync_map_file_path(
            sync_map_root_directory,
            job_os_hierarchy_type,
            custom_id,
            task.configuration["o_name"]
        )
        self.log([u"Task sync map file path: %s", task.sync_map_file_path])

        self.log(u"Replacing placeholder in os_file_smil_audio_ref")
        task.configuration["o_smil_audio_ref"] = self._replace_placeholder(
            task.configuration["o_smil_audio_ref"],
            custom_id
        )
        self.log(u"Replacing placeholder in os_file_smil_page_ref")
        task.configuration["o_smil_page_ref"] = self._replace_placeholder(
            task.configuration["o_smil_page_ref"],
            custom_id
        )
        self.log(u"Returning task")
        return task
def _create_task ( self , task_info , config_string , sync_map_root_directory , job_os_hierarchy_type ) : self . log ( u"Converting config string to config dict" ) parameters = gf . config_string_to_dict ( config_string ) self . log ( u"Creating task" ) task = Task ( config_string , logger = self . logger ) task . configuration [ "description" ] = "Task %s" % task_info [ 0 ] self . log ( [ u"Task description: %s" , task . configuration [ "description" ] ] ) try : task . configuration [ "language" ] = parameters [ gc . PPN_TASK_LANGUAGE ] self . log ( [ u"Set language from task: '%s'" , task . configuration [ "language" ] ] ) except KeyError : task . configuration [ "language" ] = parameters [ gc . PPN_JOB_LANGUAGE ] self . log ( [ u"Set language from job: '%s'" , task . configuration [ "language" ] ] ) custom_id = task_info [ 0 ] task . configuration [ "custom_id" ] = custom_id self . log ( [ u"Task custom_id: %s" , task . configuration [ "custom_id" ] ] ) task . text_file_path = task_info [ 1 ] self . log ( [ u"Task text file path: %s" , task . text_file_path ] ) task . audio_file_path = task_info [ 2 ] self . log ( [ u"Task audio file path: %s" , task . audio_file_path ] ) task . sync_map_file_path = self . _compute_sync_map_file_path ( sync_map_root_directory , job_os_hierarchy_type , custom_id , task . configuration [ "o_name" ] ) self . log ( [ u"Task sync map file path: %s" , task . sync_map_file_path ] ) self . log ( u"Replacing placeholder in os_file_smil_audio_ref" ) task . configuration [ "o_smil_audio_ref" ] = self . _replace_placeholder ( task . configuration [ "o_smil_audio_ref" ] , custom_id ) self . log ( u"Replacing placeholder in os_file_smil_page_ref" ) task . configuration [ "o_smil_page_ref" ] = self . _replace_placeholder ( task . configuration [ "o_smil_page_ref" ] , custom_id ) self . log ( u"Returning task" ) return task
Create a task object from

        1. the ``task_info`` found analyzing the container entries, and
        2. the given ``config_string``.

        :param list task_info: the task information: ``[prefix, text_path, audio_path]``
        :param string config_string: the configuration string
        :param string sync_map_root_directory: the root directory for the sync map files
        :param job_os_hierarchy_type: type of job output hierarchy
        :type  job_os_hierarchy_type: :class:`~aeneas.hierarchytype.HierarchyType`
        :rtype: :class:`~aeneas.task.Task`