code: def _select_file_guard(datasource_method):
          
          from functools import wraps
          @wraps(datasource_method)
          def wrapper(self, itraj):
              # itraj already selected, we're done.
              if itraj == self._selected_itraj:
                  return
              datasource_method(self, itraj)
              self._itraj = self._selected_itraj = itraj
          return wrapper
docs: in case we call _select_file multiple times with the same value, we do not want to reopen file handles.