CondaInterface/CondaInfoDialog.py

branch
conda
changeset 6737
26a4738dd206
parent 6730
35576138c927
child 6796
eebd0a5f10f4
equal deleted inserted replaced
6736:9a244f0d5dc0 6737:26a4738dd206
35 self.setWindowFlags(Qt.Window) 35 self.setWindowFlags(Qt.Window)
36 36
37 self.iconLabel.setPixmap( 37 self.iconLabel.setPixmap(
38 UI.PixmapCache.getPixmap("miniconda48.png")) 38 UI.PixmapCache.getPixmap("miniconda48.png"))
39 39
40 # version information
40 if "conda_version" in infoDict: 41 if "conda_version" in infoDict:
41 self.condaVersionLabel.setText( 42 self.condaVersionLabel.setText(
42 infoDict["conda_version"]) 43 infoDict["conda_version"])
43 if "conda_build_version" in infoDict: 44 if "conda_build_version" in infoDict:
44 self.condaBuildVersionLabel.setText( 45 self.condaBuildVersionLabel.setText(
45 infoDict["conda_build_version"]) 46 infoDict["conda_build_version"])
46 # TODO: add 'conda_env_version 47 if "conda_env_version" in infoDict:
48 self.condaEnvVersionLabel.setText(
49 infoDict["conda_env_version"])
47 if "python_version" in infoDict: 50 if "python_version" in infoDict:
48 self.pythonVersionLabel.setText( 51 self.pythonVersionLabel.setText(
49 infoDict["python_version"]) 52 infoDict["python_version"])
50 if "active_prefix" in infoDict and "active_prefix_name" in infoDict: 53
54 # prefixes
55 if "active_prefix" in infoDict or "active_prefix_name" in infoDict:
51 if infoDict["active_prefix_name"] and infoDict["active_prefix"]: 56 if infoDict["active_prefix_name"] and infoDict["active_prefix"]:
52 self.activeEnvironmentEdit.setText( 57 self.activeEnvironmentEdit.setText(
53 "{0} ({1})".format(infoDict["active_prefix_name"], 58 "{0} ({1})".format(infoDict["active_prefix_name"],
54 infoDict["active_prefix"])) 59 infoDict["active_prefix"]))
55 elif infoDict["active_prefix"]: 60 elif infoDict["active_prefix"]:
60 infoDict["active_prefix_name"]) 65 infoDict["active_prefix_name"])
61 else: 66 else:
62 self.activeEnvironmentEdit.setText( 67 self.activeEnvironmentEdit.setText(
63 self.tr("None")) 68 self.tr("None"))
64 else: 69 else:
65 self.activeEnvironmentEdit.setText( 70 self.activeEnvironmentLabel.hide()
66 self.tr("Unknown")) 71 self.activeEnvironmentEdit.hide()
72 if "root_prefix" in infoDict:
73 if "root_writable" in infoDict and infoDict["root_writable"]:
74 self.baseEnvironmentEdit.setText(
75 self.tr("{0} (writable)").format(infoDict["root_prefix"]))
76 else:
77 self.baseEnvironmentEdit.setText(
78 infoDict["root_prefix"])
79 if "envs_dirs" in infoDict:
80 self.envDirsEdit.setPlainText(
81 "\n".join(infoDict["envs_dirs"]))
82
83 # configurations
67 if "rc_path" in infoDict: 84 if "rc_path" in infoDict:
68 self.userConfigEdit.setText( 85 self.userConfigEdit.setText(
69 infoDict["rc_path"]) 86 infoDict["rc_path"])
70 if "user_rc_path" in infoDict: 87 if "user_rc_path" in infoDict:
71 # overwrite with more specific info 88 # overwrite with more specific info
75 self.systemConfigEdit.setText( 92 self.systemConfigEdit.setText(
76 infoDict["sys_rc_path"]) 93 infoDict["sys_rc_path"])
77 if "config_files" in infoDict: 94 if "config_files" in infoDict:
78 self.configurationsEdit.setPlainText( 95 self.configurationsEdit.setPlainText(
79 "\n".join(infoDict["config_files"])) 96 "\n".join(infoDict["config_files"]))
80 if "root_prefix" in infoDict: 97 else:
81 if "root_writable" in infoDict and infoDict["root_writable"]: 98 self.configurationsLabel.hide()
82 self.baseEnvironmentEdit.setText( 99 self.configurationsEdit.hide()
83 self.tr("{0} (writable)").format(infoDict["root_prefix"])) 100
84 else: 101 # channels
85 self.baseEnvironmentEdit.setText(
86 infoDict["root_prefix"])
87 if "channels" in infoDict: 102 if "channels" in infoDict:
88 self.channelsEdit.setPlainText( 103 self.channelsEdit.setPlainText(
89 "\n".join(infoDict["channels"])) 104 "\n".join(infoDict["channels"]))
105
106 # various
90 if "pkgs_dirs" in infoDict: 107 if "pkgs_dirs" in infoDict:
91 self.cachesEdit.setPlainText( 108 self.cachesEdit.setPlainText(
92 "\n".join(infoDict["pkgs_dirs"])) 109 "\n".join(infoDict["pkgs_dirs"]))
93 if "envs_dirs" in infoDict:
94 self.envDirsEdit.setPlainText(
95 "\n".join(infoDict["envs_dirs"]))
96 if "platform" in infoDict: 110 if "platform" in infoDict:
97 self.platformLabel.setText( 111 self.platformLabel.setText(
98 infoDict["platform"]) 112 infoDict["platform"])
99 # TODO: suppress user_agent, UID/GID and netrc_file if not present
100 if "user_agent" in infoDict: 113 if "user_agent" in infoDict:
101 self.useragentEdit.setText( 114 self.useragentEdit.setText(
102 infoDict["user_agent"]) 115 infoDict["user_agent"])
116 else:
117 self.useragentLabel.hide()
118 self.useragentEdit.hide()
103 if "UID" in infoDict and "GID" in infoDict: 119 if "UID" in infoDict and "GID" in infoDict:
104 self.uidGidLabel.setText( 120 self.uidGidDataLabel.setText(
105 "{0}:{1}".format(infoDict["UID"], infoDict["GID"])) 121 "{0}:{1}".format(infoDict["UID"], infoDict["GID"]))
122 else:
123 self.uidGidLabel.hide()
124 self.uidGidDataLabel.hide()
106 if "netrc_file" in infoDict: 125 if "netrc_file" in infoDict:
107 if infoDict["netrc_file"]: 126 if infoDict["netrc_file"]:
108 self.netrcEdit.setText( 127 self.netrcEdit.setText(
109 infoDict["netrc_file"]) 128 infoDict["netrc_file"])
110 else: 129 else:
111 self.netrcEdit.setText( 130 self.netrcEdit.setText(
112 self.tr("None")) 131 self.tr("None"))
132 else:
133 self.netrcLabel.hide()
134 self.netrcEdit.hide()
113 if "offline" in infoDict: 135 if "offline" in infoDict:
114 self.offlineCheckBox.setChecked( 136 self.offlineCheckBox.setChecked(
115 infoDict["offline"]) 137 infoDict["offline"])
116 138
117 msh = self.minimumSizeHint() 139 msh = self.minimumSizeHint()

eric ide

mercurial