libreport/0009-client-python-Add-getter-for-package-count-to-downlo.patch
Matěj Grabovský df126de8c3 Port upstream API patch
Port an addition in libreport Python API from upstream in order to
hotfix interoperability with abrt.

The commit in question:
cbb6b43038

Resolves rhbz#1906405
2020-12-11 12:29:09 +01:00

29 lines
1.0 KiB
Diff

From cbb6b43038f0d88b28197ba905ba9324c0602945 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= <mgrabovs@redhat.com>
Date: Thu, 3 Sep 2020 15:05:23 +0200
Subject: [PATCH] client-python: Add getter for package count to downloader
Add a new method get_package_count() to the DebugInfoDownload class
which returns the number of packages that will be downloaded.
---
src/client-python/reportclient/debuginfo.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index cb318e8a..eeb2be30 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -242,6 +242,9 @@ class DebugInfoDownload(object):
def get_install_size(self):
return self.installed_size
+ def get_package_count(self):
+ return len(self.package_files_dict)
+
def mute_stdout(self):
"""
Links sys.stdout with /dev/null and saves the old stdout
--
2.26.2