diff options
author | Papoteur <papoteur@mageia.org> | 2023-12-01 09:27:03 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2023-12-01 09:27:03 +0100 |
commit | 205bf52edbbe787605697b6736c70ddcd827ddf2 (patch) | |
tree | ea1f83be759d9951291cb6284aa6d15534f63aef | |
parent | 6cfc33aafce88f2e937fc2bd1d8d8474455cdb06 (diff) | |
download | mga-advisor-205bf52edbbe787605697b6736c70ddcd827ddf2.tar mga-advisor-205bf52edbbe787605697b6736c70ddcd827ddf2.tar.gz mga-advisor-205bf52edbbe787605697b6736c70ddcd827ddf2.tar.bz2 mga-advisor-205bf52edbbe787605697b6736c70ddcd827ddf2.tar.xz mga-advisor-205bf52edbbe787605697b6736c70ddcd827ddf2.zip |
Add retrieve status Security from bug report
-rw-r--r-- | mga-advisor.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mga-advisor.py b/mga-advisor.py index 03d5f05..ce99345 100644 --- a/mga-advisor.py +++ b/mga-advisor.py @@ -100,7 +100,7 @@ class Widget(QWidget): mb.exec() return QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) - url = os.path.join(BASE_URL, self.ui.bug_le.text()) + "?include_fields=cf_rpmpkg,cf_cve,url" + url = os.path.join(BASE_URL, self.ui.bug_le.text()) + "?include_fields=cf_rpmpkg,cf_cve,url,component" headers = {'Accept': 'application/json'} r = requests.get(url, headers=headers) if r.status_code == 200 and r.json()["faults"] == []: @@ -132,6 +132,11 @@ class Widget(QWidget): url = url.strip() if url != "": self.ui.list_ref.addItem(url) + if "component" in r.json()['bugs'][0].keys(): + if r.json()['bugs'][0]["component"] == "Security": + self.ui.security_rb.setChecked(True) + else: + self.ui.bugfix_rb.setChecked(True) else: self.ui.status.setText("No info retreived") QTimer.singleShot(5000, self.clean_status) @@ -172,6 +177,7 @@ class Widget(QWidget): self.ui.list_cve.takeItem(self.ui.list_cve.currentRow()) def adv_text(self): + # https://stackoverflow.com/questions/74955147/how-to-add-literal-string-pattern-in-pyyaml-with-chomping-indicator def change_style(style, representer): def new_representer(dumper, data): scalar = representer(dumper, data) |