Skip to content

Commit

Permalink
views: Replace self-rolled function for human-readable dates
Browse files Browse the repository at this point in the history
The list view uses a different date humanization method than what is
shown in the oops-window as "First detected". Reduce complexity and
improve the label in the list view by using the same functionality for
both.

After the turn of the year, problems that occurred a few days ago were
listed as "Last year", which is technically correct, but not very
helpful.
  • Loading branch information
mnme authored and msrb committed Feb 4, 2024
1 parent c4e9c36 commit f1d234e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 81 deletions.
1 change: 0 additions & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/org.freedesktop.GnomeAbrt.appdata.xml.in

src/gnome_abrt/dbus_problems.py
src/gnome_abrt/problems.py
src/gnome_abrt/tools.py
src/gnome_abrt/views.py
1 change: 0 additions & 1 deletion src/gnome_abrt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ gnome_abrt_sources = [
'errors.py',
'problems.py',
'signals.py',
'tools.py',
'views.py',
'l10n.py',
]
Expand Down
77 changes: 0 additions & 77 deletions src/gnome_abrt/tools.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/gnome_abrt/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

from gnome_abrt import problems, config, wrappers, errors
from gnome_abrt.l10n import _, C_, GETTEXT_PROGNAME
from gnome_abrt.tools import fancydate

class ProblemsFilter:

Expand Down Expand Up @@ -139,7 +138,7 @@ def problem_to_storage_values(problem):
problem_type = _("Misbehavior")

return (name,
fancydate(problem['date_last']),
humanize.naturaltime(datetime.datetime.now()-problem['date_last']),
problem_type,
problem['count'],
problem)
Expand Down

0 comments on commit f1d234e

Please sign in to comment.