def update(self, code): if code == CFD_Saturne: from code_saturne.cs_package import package if code == CFD_Neptune: from neptune_cfd.nc_package import package pkg = package() self.labelVersionValue.setText(pkg.version) self.labelPrefixValue.setText(pkg.get_dir('prefix')) self.labelCodeValue.setText(pkg.name)
def setCode(self, env_saturne, env_neptune): if env_neptune: code = CFD_Neptune from neptune_cfd.nc_package import package elif env_saturne: code = CFD_Saturne from code_saturne.cs_package import package else: raise ValueError("Invalid CFD_Code in InfoDialog class") pkg = package() self.labelVersionValue.setText(pkg.version) self.labelPrefixValue.setText(pkg.get_dir('prefix')) self.labelCodeValue.setText(pkg.name) _SetCFDCode(code)