diff --git a/0001-Remove-Expert-mode-and-the-remaining-Analyze-code.patch b/0001-Remove-Expert-mode-and-the-remaining-Analyze-code.patch new file mode 100644 index 0000000..21d088e --- /dev/null +++ b/0001-Remove-Expert-mode-and-the-remaining-Analyze-code.patch @@ -0,0 +1,108 @@ +From ab72d64818a5d88ceb4ab94f1eaae04268519e73 Mon Sep 17 00:00:00 2001 +From: Rafal Luzynski +Date: Mon, 21 Aug 2017 11:55:41 +0200 +Subject: [PATCH] Remove Expert mode and the remaining Analyze code + +The Expert mode was originally introduced together with the Analyze +feature by the commit 532cbd4. The Expert mode was intended to hide +the Analyze feature by default and show in only when the Expert mode +is on. Later the commit f5eb93f removed most of the Analyze feature +although some of its code still remained and was unused. At the same +time, probably by mistake, the Expert mode was switched to control +the visibility of the Details context menu item. + +This commit removes the Expert mode which is unused and implemented +incorrectly and any remains of the Analyze feature. Closes #182. +--- + src/gnome-abrt | 3 --- + src/gnome_abrt/controller.py.in | 7 ------- + src/gnome_abrt/oops.glade | 8 -------- + src/gnome_abrt/views.py | 7 ------- + 4 files changed, 25 deletions(-) + +diff --git a/src/gnome-abrt b/src/gnome-abrt +index f8e96e8..b1044d3 100755 +--- a/src/gnome-abrt ++++ b/src/gnome-abrt +@@ -401,8 +401,6 @@ if __name__ == "__main__": + help=_('Be verbose')) + CMDARGS.add_argument('-p', '--problem', + help=_('Selected problem ID')) +- CMDARGS.add_argument('-x', '--expert', action='store_true', +- help=_('Expert mode')) + + OPTIONS = CMDARGS.parse_args() + +@@ -414,7 +412,6 @@ if __name__ == "__main__": + CONF = get_configuration() + # TODO : mark this option as hidden or something like that + CONF.add_option('problemid', default_value=None) +- CONF.add_option('expert', default_value=(OPTIONS.expert)) + + APP_CMDLINE = [] + if 'problem' in VARS: +diff --git a/src/gnome_abrt/controller.py.in b/src/gnome_abrt/controller.py.in +index fc16dc2..86db419 100644 +--- a/src/gnome_abrt/controller.py.in ++++ b/src/gnome_abrt/controller.py.in +@@ -45,13 +45,6 @@ class Controller(object): + + problem.delete() + +- def analyze(self, problem): +- if not problem: +- logging.error("BUG: Controller: Can't open detail of None problem") +- return +- +- self.run_event_fn("open-gui", problem) +- + def _refresh_sources(self): + for name, src in self.sources: + try: +diff --git a/src/gnome_abrt/oops.glade b/src/gnome_abrt/oops.glade +index bbb732b..b8ddb42 100644 +--- a/src/gnome_abrt/oops.glade ++++ b/src/gnome_abrt/oops.glade +@@ -23,14 +23,6 @@ + + + +- +- Analy_ze +- Open selected problem for analysis +- +- +- +- +- + + D_etails + Show technical details +diff --git a/src/gnome_abrt/views.py b/src/gnome_abrt/views.py +index 82b606f..ec7b211 100644 +--- a/src/gnome_abrt/views.py ++++ b/src/gnome_abrt/views.py +@@ -527,7 +527,6 @@ class OopsWindow(Gtk.ApplicationWindow): + conf.set_watch('T_FMT', self._options_observer) + conf.set_watch('D_T_FMT', self._options_observer) + self._options_observer.option_updated(conf, 'problemid') +- self._builder.mi_detail.set_visible(conf['expert']) + + # enable observer + self._source_observer.enable() +@@ -1002,12 +1001,6 @@ _("This problem has been reported, but a Bugzilla ticket has not" + selected[0].problem_id, self) + + @handle_problem_and_source_errors +- def on_gac_analyze_activate(self, action): +- selected = self._get_selected(self.lss_problems) +- if selected: +- self._controller.analyze(selected[0]) +- +- @handle_problem_and_source_errors + def on_gac_report_activate(self, action): + selected = self._get_selected(self.lss_problems) + if selected and not selected[0]['not-reportable']: +-- +2.13.6 + diff --git a/0009-pylint-fix-some-pylint-warnings.patch b/0009-pylint-fix-some-pylint-warnings.patch new file mode 100644 index 0000000..ec95f5e --- /dev/null +++ b/0009-pylint-fix-some-pylint-warnings.patch @@ -0,0 +1,158 @@ +From 99578c5d7ce9a6ed952da292a2ed8467dc5c85d5 Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Thu, 31 May 2018 15:05:15 +0200 +Subject: [PATCH] pylint: fix some pylint warnings + +Signed-off-by: Matej Habrnal +--- + pylintrc | 2 +- + src/gnome_abrt/application.py | 2 +- + src/gnome_abrt/dbus_problems.py | 4 +--- + src/gnome_abrt/directory_problems.py | 4 ++-- + src/gnome_abrt/problems.py | 32 +++++++++----------------------- + src/gnome_abrt/views.py | 8 ++------ + 6 files changed, 16 insertions(+), 36 deletions(-) + +diff --git a/pylintrc b/pylintrc +index 934d7c0..0dc1c8e 100644 +--- a/pylintrc ++++ b/pylintrc +@@ -155,7 +155,7 @@ ignore-imports=no + [FORMAT] + + # Maximum number of characters on a single line. +-max-line-length=80 ++max-line-length=120 + + # Maximum number of lines in a module + max-module-lines=1000 +diff --git a/src/gnome_abrt/application.py b/src/gnome_abrt/application.py +index 3504b03..927262a 100644 +--- a/src/gnome_abrt/application.py ++++ b/src/gnome_abrt/application.py +@@ -16,7 +16,7 @@ + ## Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + + import os +-import gnome_abrt.wrappers as wrappers ++from gnome_abrt import wrappers + + class Application(object): + +diff --git a/src/gnome_abrt/dbus_problems.py b/src/gnome_abrt/dbus_problems.py +index 89f092e..d6574aa 100644 +--- a/src/gnome_abrt/dbus_problems.py ++++ b/src/gnome_abrt/dbus_problems.py +@@ -22,9 +22,7 @@ import traceback + import dbus + from dbus.mainloop.glib import DBusGMainLoop + +-import gnome_abrt.problems as problems +-import gnome_abrt.config as config +-import gnome_abrt.errors as errors ++from gnome_abrt import problems, config, errors + from gnome_abrt.l10n import _ + + BUS_NAME = 'org.freedesktop.problems' +diff --git a/src/gnome_abrt/directory_problems.py b/src/gnome_abrt/directory_problems.py +index 02a06ed..3ec7fe5 100644 +--- a/src/gnome_abrt/directory_problems.py ++++ b/src/gnome_abrt/directory_problems.py +@@ -30,8 +30,8 @@ import pyinotify + from pyinotify import WatchManager, Notifier, ProcessEvent + + # gnome-abrt +-import gnome_abrt.problems as problems +-import gnome_abrt.errors as errors ++from gnome_abrt import problems ++from gnome_abrt import errors + from gnome_abrt.l10n import _ + + class INOTIFYGlibSource(GLib.Source): +diff --git a/src/gnome_abrt/problems.py b/src/gnome_abrt/problems.py +index fbde9ac..05a3fa7 100644 +--- a/src/gnome_abrt/problems.py ++++ b/src/gnome_abrt/problems.py +@@ -17,6 +17,7 @@ + + import datetime + import logging ++import re + + # gnome-abrt + import gnome_abrt.url +@@ -279,6 +280,7 @@ class Problem(object): + + def get_submission(self): + if not self.submission: ++ reg = re.compile(r'^(?P.*):\s*(?P\S*)=(?P.*)') + self.submission = [] + if self['reported_to']: + # Most common type of line in reported_to file +@@ -287,30 +289,14 @@ class Problem(object): + if not line: + continue + +- pfx_lst = [] +- i = 0 +- for i in range(0, len(line)): +- if line[i] == ':': +- break +- pfx_lst.append(line[i]) +- +- pfx = ''.join(pfx_lst) +- i += 1 +- +- for i in range(i, len(line)): +- if line[i] != ' ': +- break +- +- typ_lst = [] +- for i in range(i, len(line)): +- if line[i] == '=': +- break +- typ_lst.append(line[i]) +- +- typ = ''.join(typ_lst) +- i += 1 ++ parsed = reg.match(line) ++ if parsed: ++ pfx = parsed.group('pfx') ++ typ = parsed.group('typ') ++ data = parsed.group('data') ++ else: ++ continue + +- data = line[i:] + sbm = next((s for s in self.submission + if s.rtype == typ and s.name == pfx), None) + +diff --git a/src/gnome_abrt/views.py b/src/gnome_abrt/views.py +index ec7b211..1b62515 100644 +--- a/src/gnome_abrt/views.py ++++ b/src/gnome_abrt/views.py +@@ -40,12 +40,7 @@ from gi.repository import GLib + + import humanize + +-import gnome_abrt.problems as problems +-import gnome_abrt.config as config +-import gnome_abrt.wrappers as wrappers +-import gnome_abrt.errors as errors +-import gnome_abrt.desktop as desktop +-from gnome_abrt import GNOME_ABRT_UI_DIR ++from gnome_abrt import GNOME_ABRT_UI_DIR, problems, config, wrappers, errors, desktop + from gnome_abrt.tools import fancydate, smart_truncate, load_icon + from gnome_abrt.tools import set_icon_from_pixbuf_with_scale + from gnome_abrt.l10n import _, C_, GETTEXT_PROGNAME +@@ -1075,6 +1070,7 @@ _("This problem has been reported, but a Bugzilla ticket has not" + self._builder.lb_problems.select_row(problem_row) + self._builder.menu_problem_item.popup(None, None, + None, None, data.button, data.time) ++ return None + + def get_box_header_left_offset(self): + # Returns the offset of box_header_left relative to the main paned +-- +2.13.6 + diff --git a/0010-Fix-incorrect-parsing-of-reported_to-file.patch b/0010-Fix-incorrect-parsing-of-reported_to-file.patch new file mode 100644 index 0000000..2368b99 --- /dev/null +++ b/0010-Fix-incorrect-parsing-of-reported_to-file.patch @@ -0,0 +1,39 @@ +From f26be862825fd0d476e599e6a699db4088854b4b Mon Sep 17 00:00:00 2001 +From: Matej Marusak +Date: Fri, 13 Jul 2018 09:27:28 +0200 +Subject: [PATCH] Fix incorrect parsing of reported_to file + +Fixes BZ#1600809 + +Bug was introduced in commit 99578c5. +Adding lazy operator (?) makes sure, that first occurrences are found. +This did not work on following item: + Bugzilla: URL=https://bugzilla.redhat.com/show_bug.cgi?id=123456 +Without this fix, it was split as: + - Bugzilla: URL=https + - //bugzilla.redhat.com/show_bug.cgi + - id=123456 + +With this fix first ':' and '=' are found correctly. + +Signed-off-by: Matej Marusak +--- + src/gnome_abrt/problems.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gnome_abrt/problems.py b/src/gnome_abrt/problems.py +index 05a3fa7..d9f579a 100644 +--- a/src/gnome_abrt/problems.py ++++ b/src/gnome_abrt/problems.py +@@ -280,7 +280,7 @@ class Problem(object): + + def get_submission(self): + if not self.submission: +- reg = re.compile(r'^(?P.*):\s*(?P\S*)=(?P.*)') ++ reg = re.compile(r'^(?P.*?):\s*(?P\S*?)=(?P.*)') + self.submission = [] + if self['reported_to']: + # Most common type of line in reported_to file +-- +2.13.6 + diff --git a/0012-pylint-R0205-Remove-explicit-object-inheritance.patch b/0012-pylint-R0205-Remove-explicit-object-inheritance.patch new file mode 100644 index 0000000..2818f14 --- /dev/null +++ b/0012-pylint-R0205-Remove-explicit-object-inheritance.patch @@ -0,0 +1,246 @@ +From 75166aed768007904a460807a2f0f0874af10523 Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Tue, 17 Jul 2018 12:49:34 +0200 +Subject: [PATCH] pylint(R0205): Remove explicit object inheritance + +Classes in Python3 inherit from the object implicitly. + +Signed-off-by: Martin Kutlak +--- + src/gnome-abrt | 4 ++-- + src/gnome_abrt/application.py | 2 +- + src/gnome_abrt/config.py | 2 +- + src/gnome_abrt/controller.py.in | 2 +- + src/gnome_abrt/dbus_problems.py | 4 ++-- + src/gnome_abrt/directory_problems.py | 6 +++--- + src/gnome_abrt/problems.py | 8 ++++---- + src/gnome_abrt/url/gliburltitle.py | 4 ++-- + src/gnome_abrt/views.py | 10 +++++----- + 9 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/src/gnome-abrt b/src/gnome-abrt +index a99aecf..f193c96 100755 +--- a/src/gnome-abrt ++++ b/src/gnome-abrt +@@ -87,7 +87,7 @@ GNOME_ABRT_URL_POOL_CAPACITY = 10 + + + # because of https://bugzilla.gnome.org/show_bug.cgi?id=682331 +-class GtkAppDBUSImpl(object): ++class GtkAppDBUSImpl: + """A proxy for primary application + """ + +@@ -107,7 +107,7 @@ class GtkAppDBUSImpl(object): + """DBus service method accepting a new command line arguments + """ + +- class Arguments(object): ++ class Arguments: + """Adapter for Gtk class + """ + +diff --git a/src/gnome_abrt/application.py b/src/gnome_abrt/application.py +index 927262a..40a6f0c 100644 +--- a/src/gnome_abrt/application.py ++++ b/src/gnome_abrt/application.py +@@ -18,7 +18,7 @@ + import os + from gnome_abrt import wrappers + +-class Application(object): ++class Application: + + def __init__(self, executable, name=None, icon=None): + self.executable = executable or "N/A" +diff --git a/src/gnome_abrt/config.py b/src/gnome_abrt/config.py +index 94aea46..e5662de 100644 +--- a/src/gnome_abrt/config.py ++++ b/src/gnome_abrt/config.py +@@ -29,7 +29,7 @@ def singleton(cls): + return getinstance + + @singleton +-class Configuration(object): ++class Configuration: + + def __init__(self): + self.options = {} +diff --git a/src/gnome_abrt/controller.py.in b/src/gnome_abrt/controller.py.in +index 86db419..c2991ed 100644 +--- a/src/gnome_abrt/controller.py.in ++++ b/src/gnome_abrt/controller.py.in +@@ -24,7 +24,7 @@ import traceback + from gnome_abrt import errors + from gnome_abrt.l10n import _ + +-class Controller(object): ++class Controller: + + def __init__(self, sources, sigchld_assign=None): + self.sources = sources +diff --git a/src/gnome_abrt/dbus_problems.py b/src/gnome_abrt/dbus_problems.py +index d6574aa..4c584e7 100644 +--- a/src/gnome_abrt/dbus_problems.py ++++ b/src/gnome_abrt/dbus_problems.py +@@ -40,7 +40,7 @@ def get_foreign_problems_source(mainloop=None): + + class DBusProblemSource(problems.CachedSource): + +- class Driver(object): ++ class Driver: + """Handles differences in behaviour while working with different sets + of problems obtained from D-Bus service. + """ +@@ -198,7 +198,7 @@ class StandardProblems(DBusProblemSource.Driver): + def __init__(self, source): + super(StandardProblems, self).__init__(source) + +- class ConfigObserver(object): ++ class ConfigObserver: + def __init__(self, source): + self._source = source + +diff --git a/src/gnome_abrt/directory_problems.py b/src/gnome_abrt/directory_problems.py +index 3ec7fe5..96ddc72 100644 +--- a/src/gnome_abrt/directory_problems.py ++++ b/src/gnome_abrt/directory_problems.py +@@ -150,7 +150,7 @@ class INOTIFYSourceHandler(ProcessEvent): + .format(ex)) + + +-class INOTIFYWatcher(object): ++class INOTIFYWatcher: + + def __init__(self, source, directory, context): + # context is the instance variable because +@@ -219,7 +219,7 @@ _("You have probably reached inotify's limit on the number of watches in '{0}'." + "about changes in problem data happening outside of this application. This " + "event do not affect any other functionality.").format(self._directory)) + +-class NotInitializedDirectorySource(object): ++class NotInitializedDirectorySource: + + def __init__(self, parent): + self._parent = parent +@@ -245,7 +245,7 @@ class NotInitializedDirectorySource(object): + return True + + +-class InitializedDirectoryProblemSource(object): ++class InitializedDirectoryProblemSource: + + def __init__(self, parent, directory, context=None): + self._parent = parent +diff --git a/src/gnome_abrt/problems.py b/src/gnome_abrt/problems.py +index d9f579a..5285394 100644 +--- a/src/gnome_abrt/problems.py ++++ b/src/gnome_abrt/problems.py +@@ -26,7 +26,7 @@ from gnome_abrt.errors import (InvalidProblem, + UnavailableSource) + from gnome_abrt.l10n import _ + +-class ProblemSource(object): ++class ProblemSource: + NEW_PROBLEM = 0 + DELETED_PROBLEM = 1 + CHANGED_PROBLEM = 2 +@@ -64,13 +64,13 @@ class ProblemSource(object): + def refresh(self): + pass + +-class Problem(object): ++class Problem: + INITIAL_ELEMENTS = ['component', 'executable', 'cmdline', 'count', 'type', + 'last_occurrence', 'time', 'reason', 'pkg_arch', + 'pkg_epoch', 'pkg_name', 'pkg_release', 'pkg_version', + 'environ', 'pid'] + +- class Submission(object): ++ class Submission: + URL = "URL" + MSG = "MSG" + BTHASH = "BTHASH" +@@ -319,7 +319,7 @@ class MultipleSources(ProblemSource): + + self.sources = sources + +- class SourceObserver(object): ++ class SourceObserver: + def __init__(self, parent): + self.parent = parent + +diff --git a/src/gnome_abrt/url/gliburltitle.py b/src/gnome_abrt/url/gliburltitle.py +index 44c7a6c..e4cc0f9 100644 +--- a/src/gnome_abrt/url/gliburltitle.py ++++ b/src/gnome_abrt/url/gliburltitle.py +@@ -82,7 +82,7 @@ class GetURLTitleThreadSource(GLib.Source): + pass + + +-class GetURLTitleSourcePool(object): ++class GetURLTitleSourcePool: + """Pool for reducing number of running threads at time + """ + +@@ -115,7 +115,7 @@ class GetURLTitleSourcePool(object): + self._start_resolving(url, readycallback, userdata) + + +-class GetURLTitleSourceCache(object): ++class GetURLTitleSourceCache: + """Asynchronous cache for URL titles + """ + +diff --git a/src/gnome_abrt/views.py b/src/gnome_abrt/views.py +index 1b62515..a7eabb0 100644 +--- a/src/gnome_abrt/views.py ++++ b/src/gnome_abrt/views.py +@@ -55,7 +55,7 @@ def list_box_row_set_values(list_box_row, values): + return list_box_row.get_children()[0].set_values(values) + + +-class ProblemsFilter(object): ++class ProblemsFilter: + + def __init__(self, list_box, list_box_selection): + self._pattern = "" +@@ -201,7 +201,7 @@ def handle_problem_and_source_errors(func): + return wrapper_for_instance_function + + +-class ListBoxSelection(object): ++class ListBoxSelection: + + def __init__(self, list_box, selection_changed): + self._lb = list_box +@@ -288,7 +288,7 @@ class OopsWindow(Gtk.ApplicationWindow): + + _TITLE = _("Problem Reporting") + +- class OopsGtkBuilder(object): ++ class OopsGtkBuilder: + def __init__(self): + builder = None + # try to load the glade from git at first step +@@ -412,7 +412,7 @@ class OopsWindow(Gtk.ApplicationWindow): + return obj + + +- class SourceObserver(object): ++ class SourceObserver: + def __init__(self, wnd): + self.wnd = wnd + self._enabled = True +@@ -443,7 +443,7 @@ class OopsWindow(Gtk.ApplicationWindow): + self.wnd._disable_source(ex.source, ex.temporary) + + +- class OptionsObserver(object): ++ class OptionsObserver: + def __init__(self, wnd): + self.wnd = wnd + +-- +2.13.6 + diff --git a/gnome-abrt-1.2.6.tar.gz b/gnome-abrt-1.2.6.tar.gz new file mode 100644 index 0000000..0e00b82 Binary files /dev/null and b/gnome-abrt-1.2.6.tar.gz differ diff --git a/gnome-abrt.spec b/gnome-abrt.spec new file mode 100644 index 0000000..7f08f8c --- /dev/null +++ b/gnome-abrt.spec @@ -0,0 +1,66 @@ +Name: gnome-abrt +Version: 1.2.6 +Release: 10 +Summary: A utility for viewing problems that have occurred with the system +License: GPLv2+ +URL: https://github.com/abrt/gnome-abrt +Source0: https://github.com/abrt/gnome-abrt/archive/%{version}/gnome-abrt-%{version}.tar.gz +Patch0001: 0001-Remove-Expert-mode-and-the-remaining-Analyze-code.patch +Patch0002: 0009-pylint-fix-some-pylint-warnings.patch +Patch0003: 0010-Fix-incorrect-parsing-of-reported_to-file.patch +Patch0004: 0012-pylint-R0205-Remove-explicit-object-inheritance.patch +BuildRequires: intltool gettext libtool python3-devel desktop-file-utils +BuildRequires: asciidoc xmlto pygobject3-devel libreport-gtk-devel >= 2.6.0 +BuildRequires: python3-libreport abrt-gui-devel >= 2.6.0 gtk3-devel libX11-devel +BuildRequires: python3-six python3-inotify python3-gobject +BuildRequires: python3-dbus python3-humanize +BuildRequires: python3-pylint +Requires: python3-libreport python3-inotify python3-gobject +Requires: python3-dbus xdg-utils python3-humanize + +%description +Gnome-abrt is a graphical user interface which allows users to analyze and +report application crashes, system failures and other problems. + +%package help +Summary: Help for gnome-abrt +BuildArch: noarch + +%description help +This package contains man manual for gnome-abrt. + +%prep +%autosetup -p1 + +%build +./autogen.sh +autoconf +%configure %{?checkoption} +%make_build + +%install +%make_install mandir=%{_mandir} + +%find_lang gnome-abrt +find ./ -name "*.a" -exec rm -rf {} \; +find ./ -name "*.la" -exec rm -rf {} \; +desktop-file-install --dir ${RPM_BUILD_ROOT}%{_datadir}/applications --delete-original \ + ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop + +%check +make check + +%files -f gnome-abrt.lang +%doc COPYING README.md +%{python3_sitearch}/gnome_abrt +%{_datadir}/{gnome-abrt,applications/*,appdata/*} +%{_datadir}/icons/hicolor/{*/apps/*,*/status/*} +%{_bindir}/gnome-abrt +%{_datadir}/doc/gnome-abrt/README.md + +%files help +%{_mandir}/man1/gnome-abrt.1* + +%changelog +* Fri Dec 6 2019 Tianfei - 1.2.6-10 +- Package init