eric6/PipInterface/PipPackageDetailsDialog.py

changeset 8086
eff504bb6dec
parent 7923
91e843545d9a
child 8090
c53117374255
equal deleted inserted replaced
8085:f6db8b3ecea9 8086:eff504bb6dec
13 ) 13 )
14 14
15 from .Ui_PipPackageDetailsDialog import Ui_PipPackageDetailsDialog 15 from .Ui_PipPackageDetailsDialog import Ui_PipPackageDetailsDialog
16 16
17 17
18 # TODO: add some 'convenience' buttons (see issue369)
18 class PipPackageDetailsDialog(QDialog, Ui_PipPackageDetailsDialog): 19 class PipPackageDetailsDialog(QDialog, Ui_PipPackageDetailsDialog):
19 """ 20 """
20 Class implementing a dialog to show details about a package. 21 Class implementing a dialog to show details about a package.
21 """ 22 """
22 def __init__(self, detailsData, parent=None): 23 def __init__(self, detailsData, parent=None):
78 '<a href="{0}">{0}</a>'.format( 79 '<a href="{0}">{0}</a>'.format(
79 self.__sanitize(detailsData["release_url"], forUrl=True))) 80 self.__sanitize(detailsData["release_url"], forUrl=True)))
80 self.docsUrlLabel.setText( 81 self.docsUrlLabel.setText(
81 '<a href="{0}">{0}</a>'.format( 82 '<a href="{0}">{0}</a>'.format(
82 self.__sanitize(detailsData["docs_url"], forUrl=True))) 83 self.__sanitize(detailsData["docs_url"], forUrl=True)))
83 self.downloadsDayLabel.setText(self.__locale.toString(
84 detailsData["downloads"]["last_day"]))
85 self.downloadsWeekLabel.setText(self.__locale.toString(
86 detailsData["downloads"]["last_week"]))
87 self.downloadsMonthLabel.setText(self.__locale.toString(
88 detailsData["downloads"]["last_month"]))
89 self.classifiersList.addItems(detailsData["classifiers"]) 84 self.classifiersList.addItems(detailsData["classifiers"])
90 85
91 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 86 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
92 self.buttonBox.button(QDialogButtonBox.Close).setFocus( 87 self.buttonBox.button(QDialogButtonBox.Close).setFocus(
93 Qt.OtherFocusReason) 88 Qt.OtherFocusReason)
109 if download["packagetype"] in self.__packageTypeMap 104 if download["packagetype"] in self.__packageTypeMap
110 else "", 105 else "",
111 download["python_version"] 106 download["python_version"]
112 if download["python_version"] != "source" 107 if download["python_version"] != "source"
113 else "", 108 else "",
114 self.__locale.toString(download["downloads"]),
115 self.__formatUploadDate(download["upload_time"]), 109 self.__formatUploadDate(download["upload_time"]),
116 self.__formatSize(download["size"]), 110 self.__formatSize(download["size"]),
117 ]) 111 ])
118 if download["has_sig"]: 112 if download["has_sig"]:
119 pgpLink = ' (<a href="{0}">pgp</a>)'.format( 113 pgpLink = ' (<a href="{0}">pgp</a>)'.format(

eric ide

mercurial