Sun, 10 Feb 2019 19:46:34 +0100
Conda: started implementing the conda menu functionality
- About Conda
- Edit User Configuration
- Configure
# -*- coding: utf-8 -*- # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the conda information dialog. """ from __future__ import unicode_literals from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialog from .Ui_CondaInfoDialog import Ui_CondaInfoDialog import UI.PixmapCache class CondaInfoDialog(QDialog, Ui_CondaInfoDialog): """ Class implementing the conda information dialog. """ def __init__(self, infoDict, parent=None): """ Constructor @param infoDict dictionary containing the information to be shown @type dict @param parent reference to the parent widget @type QWidget """ super(CondaInfoDialog, self).__init__(parent) self.setupUi(self) self.setWindowFlags(Qt.Window) self.iconLabel.setPixmap( UI.PixmapCache.getPixmap("miniconda48.png")) if "conda_version" in infoDict: self.condaVersionLabel.setText( infoDict["conda_version"]) if "conda_build_version" in infoDict: self.condaBuildVersionLabel.setText( infoDict["conda_build_version"]) if "python_version" in infoDict: self.pythonVersionLabel.setText( infoDict["python_version"]) if "active_prefix" in infoDict and "active_prefix_name" in infoDict: if infoDict["active_prefix_name"] and infoDict["active_prefix"]: self.activeEnvironmentEdit.setText( "{0} ({1})".format(infoDict["active_prefix_name"], infoDict["active_prefix"])) elif infoDict["active_prefix"]: self.activeEnvironmentEdit.setText( infoDict["active_prefix"]) elif infoDict["active_prefix_name"]: self.activeEnvironmentEdit.setText( infoDict["active_prefix_name"]) else: self.activeEnvironmentEdit.setText( self.tr("None")) if "rc_path" in infoDict: self.userConfigEdit.setText( infoDict["rc_path"]) if "user_rc_path" in infoDict: # overwrite with more specific info self.userConfigEdit.setText( infoDict["user_rc_path"]) if "sys_rc_path" in infoDict: self.systemConfigEdit.setText( infoDict["sys_rc_path"]) 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"]) if "channels" in infoDict: self.channelsEdit.setPlainText( "\n".join(infoDict["channels"])) 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"]) if "user_agent" in infoDict: self.useragentEdit.setText( infoDict["user_agent"]) if "UID" in infoDict and "GID" in infoDict: self.uidGidLabel.setText( "{0}:{1}".format(infoDict["UID"], infoDict["GID"])) if "netrc_file" in infoDict: if infoDict["netrc_file"]: self.netrcEdit.setText( infoDict["netrc_file"]) else: self.netrcEdit.setText( self.tr("None")) if "offline" in infoDict: self.offlineCheckBox.setChecked( infoDict["offline"])