software-properties: replace deprecated lsb_release and fix style.

This commit is contained in:
Luis Guzmán 2024-08-03 22:56:51 +00:00
parent ccc3d1bd30
commit 7ead729db4
4 changed files with 53 additions and 9 deletions

View file

@ -0,0 +1,14 @@
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
index d76513f7..0a08c820 100644
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
@@ -454,9 +454,6 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
else:
eol_expiry_text = _("Active until %s") % eol_date.strftime("%x")
self.label_eol.set_label(eol_expiry_text)
- self.label_esm_subscribe.set_markup(
- "<a href=\"%s\">%s</a>" % (esm_url, _("Extend…"))
- )
self.label_esm_subscribe.set_visible(
esm_available and not esm_enabled
)

View file

@ -0,0 +1,24 @@
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
index a91d2595..940fd790 100644
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
@@ -251,9 +251,6 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
self.show_distro()
# Setup and show the Additonal Drivers tab
self.init_drivers()
- # Setup and show the Trisquel Pro tab if the serie is a LTS
- if is_current_distro_lts():
- self.init_ubuntu_pro()
# Connect to switch-page before setting initial tab. Otherwise the
# first switch goes unnoticed.
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
index c18bcd09..15f78ef3 100644
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
@@ -1636,5 +1636,3 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
else:
self.label_driver_action.set_label(_("No proprietary drivers are in use."))
- def init_ubuntu_pro(self):
- self.ubuntu_pro_page = TrisquelProPage(self)

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2021 Luis Guzman <ark@switnet.org>
# Copyright (C) 2024 Luis Guzman <ark@switnet.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -16,12 +16,15 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# replaced lsb_release in favor of distro
import csv
import lsb_release
from datetime import datetime
from distro import distro
release_name = lsb_release.get_distro_information()['CODENAME']
release_description = lsb_release.get_distro_information()['DESCRIPTION']
release_name = distro.codename()
release_description = distro.name(pretty=True)
#print(release_name)
#print(release_description)
def trisquel_eol():
with open('/usr/share/distro-info/trisquel.csv', 'r') as distro_data: