def _eventBrowse(self, b): """ Handles browse button on_click event """ self._out2.clear_output() self._modelPath.value = getPath() if 'crop2ml' not in os.listdir(self._modelPath.value): self._modelPath.value = '' with self._out2: print('This repository is not a model package.')
def _eventAdd_new(b): """ Handles add_new button on_click event """ self._out2.clear_output() extpkg = getPath() if not 'crop2ml' in os.listdir(extpkg): with self._out2: print('This repository is not a model package.') elif extpkg in _listpkgAdded_Options or extpkg + os.path.sep + 'crop2ml' == self._datas[ 'Path']: with self._out2: print('This package is already in the list.') else: _listpkgAdded_Options.append(extpkg) _listpkgAdded.options = _listpkgAdded_Options
def _eventAdd(self, b): """ Handles add button on_click event """ self._out2.clear_output() extpkg = getPath() if 'crop2ml' not in os.listdir(extpkg): with self._out2: print('This repository is not a model package.') elif any([ extpkg in self._listpkg, extpkg + os.path.sep + 'crop2ml' == self._datas['Path'] ]): with self._out2: print('This package is already in the list.') else: self._listpkg.append(extpkg) self._list.options = self._listpkg