mirror of
https://github.com/aclist/dztui.git
synced 2026-11-01 07:32:44 +01:00
31 lines
886 B
Python
31 lines
886 B
Python
from typing import TYPE_CHECKING
|
|
from importlib import resources
|
|
|
|
from dzgui.const.constants import APP_NAME_LOWER
|
|
from dzgui.util.format import format_pango
|
|
|
|
import gi
|
|
gi.require_version("Gtk", "3.0")
|
|
from gi.repository import Gtk # noqa E402
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
from dzgui.controllers.mc import Controller
|
|
|
|
class Changelog(Gtk.Box):
|
|
def __init__(self, controller: "Controller"):
|
|
super().__init__()
|
|
|
|
try:
|
|
changelog = resources.read_text(APP_NAME_LOWER, "data/CHANGELOG.md")
|
|
except OSError as e:
|
|
changelog = "Error: Failed to read changelog"
|
|
# TODO: log error
|
|
|
|
# TODO: should long text be wrapped?
|
|
|
|
formatted = format_pango(changelog)
|
|
self.changelog_label = Gtk.Label(valign=Gtk.Align.START, margin=15)
|
|
self.changelog_label.set_markup(formatted)
|
|
self.add(self.changelog_label)
|