--- a/CondaInterface/CondaInfoDialog.py Wed Feb 13 19:01:34 2019 +0100 +++ b/CondaInterface/CondaInfoDialog.py Wed Feb 13 19:03:29 2019 +0100 @@ -37,17 +37,22 @@ self.iconLabel.setPixmap( UI.PixmapCache.getPixmap("miniconda48.png")) + # version information if "conda_version" in infoDict: self.condaVersionLabel.setText( infoDict["conda_version"]) if "conda_build_version" in infoDict: self.condaBuildVersionLabel.setText( infoDict["conda_build_version"]) - # TODO: add 'conda_env_version + if "conda_env_version" in infoDict: + self.condaEnvVersionLabel.setText( + infoDict["conda_env_version"]) if "python_version" in infoDict: self.pythonVersionLabel.setText( infoDict["python_version"]) - if "active_prefix" in infoDict and "active_prefix_name" in infoDict: + + # prefixes + if "active_prefix" in infoDict or "active_prefix_name" in infoDict: if infoDict["active_prefix_name"] and infoDict["active_prefix"]: self.activeEnvironmentEdit.setText( "{0} ({1})".format(infoDict["active_prefix_name"], @@ -62,8 +67,20 @@ self.activeEnvironmentEdit.setText( self.tr("None")) else: - self.activeEnvironmentEdit.setText( - self.tr("Unknown")) + self.activeEnvironmentLabel.hide() + self.activeEnvironmentEdit.hide() + if "root_prefix" in infoDict: + if "root_writable" in infoDict and infoDict["root_writable"]: + self.baseEnvironmentEdit.setText( + self.tr("{0} (writable)").format(infoDict["root_prefix"])) + else: + self.baseEnvironmentEdit.setText( + infoDict["root_prefix"]) + if "envs_dirs" in infoDict: + self.envDirsEdit.setPlainText( + "\n".join(infoDict["envs_dirs"])) + + # configurations if "rc_path" in infoDict: self.userConfigEdit.setText( infoDict["rc_path"]) @@ -77,32 +94,34 @@ if "config_files" in infoDict: self.configurationsEdit.setPlainText( "\n".join(infoDict["config_files"])) - if "root_prefix" in infoDict: - if "root_writable" in infoDict and infoDict["root_writable"]: - self.baseEnvironmentEdit.setText( - self.tr("{0} (writable)").format(infoDict["root_prefix"])) - else: - self.baseEnvironmentEdit.setText( - infoDict["root_prefix"]) + else: + self.configurationsLabel.hide() + self.configurationsEdit.hide() + + # channels if "channels" in infoDict: self.channelsEdit.setPlainText( "\n".join(infoDict["channels"])) + + # various if "pkgs_dirs" in infoDict: self.cachesEdit.setPlainText( "\n".join(infoDict["pkgs_dirs"])) - if "envs_dirs" in infoDict: - self.envDirsEdit.setPlainText( - "\n".join(infoDict["envs_dirs"])) if "platform" in infoDict: self.platformLabel.setText( infoDict["platform"]) - # TODO: suppress user_agent, UID/GID and netrc_file if not present if "user_agent" in infoDict: self.useragentEdit.setText( infoDict["user_agent"]) + else: + self.useragentLabel.hide() + self.useragentEdit.hide() if "UID" in infoDict and "GID" in infoDict: - self.uidGidLabel.setText( + self.uidGidDataLabel.setText( "{0}:{1}".format(infoDict["UID"], infoDict["GID"])) + else: + self.uidGidLabel.hide() + self.uidGidDataLabel.hide() if "netrc_file" in infoDict: if infoDict["netrc_file"]: self.netrcEdit.setText( @@ -110,6 +129,9 @@ else: self.netrcEdit.setText( self.tr("None")) + else: + self.netrcLabel.hide() + self.netrcEdit.hide() if "offline" in infoDict: self.offlineCheckBox.setChecked( infoDict["offline"])