src/aoikhotkey/task_manager.py
def add_task(self, func):
        """
        Add task function to be run in the task manager's thread pool.

        :param func: Task function.

        :return: None.
        """
        # Create wrapper function
        def func_wrapper():
            try:
                # Call given function
                func()

            # If have error
            except BaseException:
                # Get traceback message
                tb_msg = format_exc()

                # Get error message
                msg = (
                    '# Error calling function in task thread:\n'
                    '---\n{0}---\n'
                ).format(tb_msg)

                # Print error message
                sys.stderr.write(msg)

        # Run the wrapper function in the thread pool
        self._thread_pool.apply_async(func_wrapper)

        Add task function to be run in the task manager's thread pool.

        :param func: Task function.

        :return: None.
        
Add task function to be run in the task manager's thread pool.
Add task function to be run in the task manager ' s thread pool .
def add_task(self, func):
        def func_wrapper():
            try:
                func()
            except BaseException:
                tb_msg = format_exc()
                msg = (
                    '# Error calling function in task thread:\n'
                    '---\n{0}---\n'
                ).format(tb_msg)
                sys.stderr.write(msg)
        self._thread_pool.apply_async(func_wrapper)
def add_task ( self , func ) : def func_wrapper ( ) : try : func ( ) except BaseException : tb_msg = format_exc ( ) msg = ( '# Error calling function in task thread:\n' '---\n{0}---\n' ) . format ( tb_msg ) sys . stderr . write ( msg ) self . _thread_pool . apply_async ( func_wrapper )
Add task function to be run in the task manager's thread pool.
Add task function to be run in the task manager ' s thread pool .
"""
        Add task function to be run in the task manager's thread pool.

        :param func: Task function.

        :return: None.
        """ # Create wrapper function # Call given function # If have error # Get traceback message # Get error message # Print error message # Run the wrapper function in the thread pool
None
self
func
None