def tableActionViewRepo_Bg( self, execute_function, are_you_sure_function=None, finalise_function=None ): self._debug( 'tableActionViewRepo_Bg start' ) all_filenames = self.__tableActionViewRepoPrep( are_you_sure_function ) if len(all_filenames) > 0: scm_project = self.selectedScmProject() for filename in all_filenames: if wb_background_thread.requiresThreadSwitcher( execute_function ): self._debug( 'tableActionViewRepo_Bg exec yield from %r' % (execute_function,) ) yield from execute_function( scm_project, filename ) else: self._debug( 'tableActionViewRepo_Bg exec call %r' % (execute_function,) ) execute_function( scm_project, filename ) if finalise_function is not None: if wb_background_thread.requiresThreadSwitcher( finalise_function ): self._debug( 'tableActionViewRepo_Bg fin yield from %r' % (finalise_function,) ) yield from finalise_function( scm_project ) else: self._debug( 'tableActionViewRepo_Bg fin call %r' % (finalise_function,) ) finalise_function( scm_project ) self._debug( 'tableActionViewRepo_Bg done' )
def callTreeOrTableFunction_Bg( self, fn_tree, fn_table ): if self.focusIsIn() == 'tree': if wb_background_thread.requiresThreadSwitcher( fn_tree ): yield from fn_tree() else: return fn_tree() elif self.focusIsIn() == 'table': if wb_background_thread.requiresThreadSwitcher( fn_table ): yield from fn_table() else: return fn_table() else: assert False, 'must be tree or table but is %r' % (self.focusIsIn(),)
def callTreeOrTableFunction_Bg(self, fn_tree, fn_table): if self.focusIsIn() == 'tree': if wb_background_thread.requiresThreadSwitcher(fn_tree): yield from fn_tree() else: return fn_tree() elif self.focusIsIn() == 'table': if wb_background_thread.requiresThreadSwitcher(fn_table): yield from fn_table() else: return fn_table() else: assert False, 'must be tree or table but is %r' % ( self.focusIsIn(), )
def tableActionViewRepo_Bg(self, execute_function, are_you_sure_function=None, finalise_function=None): self.debugLog('tableActionViewRepo_Bg start') all_filenames = self.__tableActionViewRepoPrep(are_you_sure_function) if len(all_filenames) > 0: scm_project = self.selectedScmProject() for filename in all_filenames: if wb_background_thread.requiresThreadSwitcher( execute_function): self.debugLog( 'tableActionViewRepo_Bg exec yield from %r' % (execute_function, )) yield from execute_function(scm_project, filename) else: self.debugLog( 'tableActionViewRepo_Bg exec call %r( %r, %r )' % (execute_function, scm_project, filename)) execute_function(scm_project, filename) if finalise_function is not None: if wb_background_thread.requiresThreadSwitcher( finalise_function): self.debugLog('tableActionViewRepo_Bg fin yield from %r' % (finalise_function, )) yield from finalise_function(scm_project) else: self.debugLog('tableActionViewRepo_Bg fin call %r' % (finalise_function, )) finalise_function(scm_project) self.debugLog('tableActionViewRepo_Bg done')