parameters: (self, listener=None, **kw)
docstring: Parameters
          ----------
          listener: object, optional
              Object with methods named as following callback parameters.
          onJobStart: callable(task), optional
              Called when the task synchronization starts.
          onJobEnd: callable(task, status, result), optional
              Called when the task synchronization ends.
          onJobUpdate: callable(task, status), optional
              Called periodically during synchronization to report current state.
          onFinish: callable(terminated), optional
              Called when synchronizer ends its work - either all tasks are
              processed or synchronization was terminated;
          onError: callable(task, source, error), optional
              Called to report non-terminal errors. Non-terminal errors are errors
              not causing synchronizer to stop, but could impact results, e.g. audio
              decoding errors.
  
          Notes
          -----
          Callbacks arguments:
  
          - task : `subsync.synchro.SyncTask` - object passed to
              `SyncController.synchronize`;
          - status : `SyncStatus` - object reflecting current synchronization state;
          - result : `SyncJobResult`;
          - terminated : `bool` - whether synchronization was terminated;
          - source : `str` - error source, could be 'sub' or 'ref' for
              subtitle/reference extractor or 'core';
          - error - exception instance.
docstring_summary: Parameters
          ----------
          listener: object, optional
              Object with methods named as following callback parameters.
          onJobStart: callable(task), optional
              Called when the task synchronization starts.
          onJobEnd: callable(task, status, result), optional
              Called when the task synchronization ends.
          onJobUpdate: callable(task, status), optional
              Called periodically during synchronization to report current state.
          onFinish: callable(terminated), optional
              Called when synchronizer ends its work - either all tasks are
              processed or synchronization was terminated;
          onError: callable(task, source, error), optional
              Called to report non-terminal errors. Non-terminal errors are errors
              not causing synchronizer to stop, but could impact results, e.g. audio
              decoding errors.
docstring_tokens: Parameters ---------- listener : object optional Object with methods named as following callback parameters . onJobStart : callable ( task ) optional Called when the task synchronization starts . onJobEnd : callable ( task status result ) optional Called when the task synchronization ends . onJobUpdate : callable ( task status ) optional Called periodically during synchronization to report current state . onFinish : callable ( terminated ) optional Called when synchronizer ends its work - either all tasks are processed or synchronization was terminated ; onError : callable ( task source error ) optional Called to report non - terminal errors . Non - terminal errors are errors not causing synchronizer to stop but could impact results e . g . audio decoding errors .
function: def __init__(self, listener=None, **kw):
          """
          Parameters
          ----------
          listener: object, optional
              Object with methods named as following callback parameters.
          onJobStart: callable(task), optional
              Called when the task synchronization starts.
          onJobEnd: callable(task, status, result), optional
              Called when the task synchronization ends.
          onJobUpdate: callable(task, status), optional
              Called periodically during synchronization to report current state.
          onFinish: callable(terminated), optional
              Called when synchronizer ends its work - either all tasks are
              processed or synchronization was terminated;
          onError: callable(task, source, error), optional
              Called to report non-terminal errors. Non-terminal errors are errors
              not causing synchronizer to stop, but could impact results, e.g. audio
              decoding errors.
  
          Notes
          -----
          Callbacks arguments:
  
          - task : `subsync.synchro.SyncTask` - object passed to
              `SyncController.synchronize`;
          - status : `SyncStatus` - object reflecting current synchronization state;
          - result : `SyncJobResult`;
          - terminated : `bool` - whether synchronization was terminated;
          - source : `str` - error source, could be 'sub' or 'ref' for
              subtitle/reference extractor or 'core';
          - error - exception instance.
          """
          self._onJobStart = kw.get('onJobStart', getattr(listener, 'onJobStart', lambda task: None))
          self._onJobInit = kw.get('onJobInit', getattr(listener, 'onJobInit', lambda task: None))
          self._onJobEnd = kw.get('onJobEnd', getattr(listener, 'onJobEnd', lambda task, status, result: None))
          self._onJobUpdate = kw.get('onJobUpdate', getattr(listener, 'onJobUpdate', lambda task, status: None))
          self._onFinish = kw.get('onFinish', getattr(listener, 'onFinish', lambda terminated: None))
          self._onError = kw.get('onError', getattr(listener, 'onError', lambda task, source, error: None))
  
          self._options = settings().getSynchronizationOptions()
          self._thread = None
          self._semaphore = threading.Semaphore()
          self._sync = None
          self._terminated = False
function_tokens: def __init__ ( self , listener = None , * * kw ) : self . _onJobStart = kw . get ( 'onJobStart' , getattr ( listener , 'onJobStart' , lambda task : None ) ) self . _onJobInit = kw . get ( 'onJobInit' , getattr ( listener , 'onJobInit' , lambda task : None ) ) self . _onJobEnd = kw . get ( 'onJobEnd' , getattr ( listener , 'onJobEnd' , lambda task , status , result : None ) ) self . _onJobUpdate = kw . get ( 'onJobUpdate' , getattr ( listener , 'onJobUpdate' , lambda task , status : None ) ) self . _onFinish = kw . get ( 'onFinish' , getattr ( listener , 'onFinish' , lambda terminated : None ) ) self . _onError = kw . get ( 'onError' , getattr ( listener , 'onError' , lambda task , source , error : None ) ) self . _options = settings ( ) . getSynchronizationOptions ( ) self . _thread = None self . _semaphore = threading . Semaphore ( ) self . _sync = None self . _terminated = False