def refresh(self, new_path=None, force_current=False):
        """Refresh widget
        force=False: won't refresh widget if path has not changed"""
        if new_path is None:
            new_path = getcwd_or_home()
        if force_current:
            index = self.set_current_folder(new_path)
            self.expand(index)
            self.setCurrentIndex(index)
        self.set_previous_enabled.emit(
                             self.histindex is not None and self.histindex > 0)
        self.set_next_enabled.emit(self.histindex is not None and \
                                   self.histindex < len(self.history)-1)
        # Disable the view of .spyproject. 
        self.filter_directories()
def refresh ( self , new_path = None , force_current = False ) : if new_path is None : new_path = getcwd_or_home ( ) if force_current : index = self . set_current_folder ( new_path ) self . expand ( index ) self . setCurrentIndex ( index ) self . set_previous_enabled . emit ( self . histindex is not None and self . histindex > 0 ) self . set_next_enabled . emit ( self . histindex is not None and self . histindex < len ( self . history ) - 1 ) self . filter_directories ( )
Refresh widget
        force=False: won't refresh widget if path has not changed