Skip to content
Snippets Groups Projects
Commit 36d989a2 authored by Emmanuel Heriberto Oceguera Conchas's avatar Emmanuel Heriberto Oceguera Conchas
Browse files

Attributes info has been added into the QTextBrowser

parent 88209a2d
Branches
No related tags found
No related merge requests found
...@@ -165,7 +165,14 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -165,7 +165,14 @@ class maskAndFuntionality (BASE, WIDGET):
longNameVariables2 = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].long_name longNameVariables2 = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].long_name
child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2]) child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2])
child2.addChild(child3) child2.addChild(child3)
#we get the attributes of the variables of the groups of the groups and show them in the QTextBrowser if the variable is clicked
if child3.isSelected():
ncFileVariablesName2Attributes = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].ncattrs())
for l in range(len(ncFileVariablesName2Attributes)):
ncFileVariablesName2AttributesValue = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].getncattr(ncFileVariablesName2Attributes[l])
self.text_info.append(ncFileVariablesName2Attributes[l] + ": " + str(ncFileVariablesName2AttributesValue))
#we get the variables of the groups #we get the variables of the groups
ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys()) ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys())
...@@ -182,8 +189,11 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -182,8 +189,11 @@ class maskAndFuntionality (BASE, WIDGET):
""" here we are gonna show all information into the GUI""" """ here we are gonna show all information into the GUI"""
#set all information about the file into the text browser #we get the attributes of the file and show them in the QTextBrowser when the file is loaded
self.text_info.setText("File name: " + ncFileName) ncFileAttributes = list(ncFile.ncattrs())
for i in range(len(ncFileAttributes)):
ncFileAttributesValue = ncFile.getncattr(ncFileAttributes[i])
self.text_info.append(ncFileAttributes[i] + ": " + str(ncFileAttributesValue))
#we close the netCDF file #we close the netCDF file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment