From dd4c28a2d71353d40f59cc94b353c3e0ba053981 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Feb 06 2024 23:59:05 +0000 Subject: Fix python NameError: '_' is not defined --- diff --git a/514.patch b/514.patch new file mode 100644 index 0000000..464fffd --- /dev/null +++ b/514.patch @@ -0,0 +1,99 @@ +From 2341c7083e25aa71e1e6b67d29fa61f38a9c3e35 Mon Sep 17 00:00:00 2001 +From: Leigh Scott +Date: Tue, 30 Jan 2024 22:37:23 +0000 +Subject: [PATCH] Fix python NameError: '_' is not defined + +--- + nemo-audio-tab/nemo-extension/nemo-audio-tab.py | 3 +++ + nemo-compare/src/nemo-compare.py | 3 +++ + nemo-emblems/nemo-extension/nemo-emblems.py | 3 +++ + nemo-media-columns/nemo-media-columns.py | 3 +++ + nemo-pastebin/src/nemo-pastebin.py | 3 +++ + nemo-terminal/src/nemo_terminal.py | 4 ++++ + 6 files changed, 19 insertions(+) + +diff --git a/nemo-audio-tab/nemo-extension/nemo-audio-tab.py b/nemo-audio-tab/nemo-extension/nemo-audio-tab.py +index 156e9d35..ac9c7d11 100644 +--- a/nemo-audio-tab/nemo-extension/nemo-audio-tab.py ++++ b/nemo-audio-tab/nemo-extension/nemo-audio-tab.py +@@ -13,6 +13,9 @@ + from mutagen.mp3 import MP3 + from mutagen.flac import FLAC, StreamInfo + ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + class AudioPropertyPage(GObject.GObject, Nemo.PropertyPageProvider, Nemo.NameAndDescProvider): + + def get_property_pages(self, files): +diff --git a/nemo-compare/src/nemo-compare.py b/nemo-compare/src/nemo-compare.py +index dfd1704c..ff2cf10e 100644 +--- a/nemo-compare/src/nemo-compare.py ++++ b/nemo-compare/src/nemo-compare.py +@@ -25,6 +25,9 @@ + from gi.repository import GLib + signal.signal(signal.SIGINT, signal.SIG_DFL) + ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + import gi + gi.require_version('Nemo', '3.0') + from gi.repository import Nemo, GObject, Gio +diff --git a/nemo-emblems/nemo-extension/nemo-emblems.py b/nemo-emblems/nemo-extension/nemo-emblems.py +index 80e64b34..2b2cc841 100644 +--- a/nemo-emblems/nemo-extension/nemo-emblems.py ++++ b/nemo-emblems/nemo-extension/nemo-emblems.py +@@ -8,6 +8,9 @@ + + from gi.repository import Nemo + ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + # i18n + APP = 'nemo-extensions' + LOCALE_DIR = "/usr/share/locale" +diff --git a/nemo-media-columns/nemo-media-columns.py b/nemo-media-columns/nemo-media-columns.py +index d62237ad..e113ea14 100644 +--- a/nemo-media-columns/nemo-media-columns.py ++++ b/nemo-media-columns/nemo-media-columns.py +@@ -40,6 +40,9 @@ + # for reading pdf + from PyPDF2 import PdfFileReader + ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + import signal + signal.signal(signal.SIGINT, signal.SIG_DFL) + +diff --git a/nemo-pastebin/src/nemo-pastebin.py b/nemo-pastebin/src/nemo-pastebin.py +index 24c52dee..0440d332 100755 +--- a/nemo-pastebin/src/nemo-pastebin.py ++++ b/nemo-pastebin/src/nemo-pastebin.py +@@ -37,6 +37,9 @@ + gi.require_version('Nemo', '3.0') + from gi.repository import Nemo + ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + try: + gi.require_version('Notify', '0.7') + from gi.repository import Notify +diff --git a/nemo-terminal/src/nemo_terminal.py b/nemo-terminal/src/nemo_terminal.py +index a32e0d99..568af961 100755 +--- a/nemo-terminal/src/nemo_terminal.py ++++ b/nemo-terminal/src/nemo_terminal.py +@@ -47,6 +47,10 @@ + import codecs + + import gettext ++ ++# Import the gettext function and alias it as _ ++from gettext import gettext as _ ++ + gettext.bindtextdomain("nemo-extensions") + gettext.textdomain("nemo-extensions") + _ = gettext.gettext diff --git a/nemo-extensions.spec b/nemo-extensions.spec index fd33975..6ebd734 100644 --- a/nemo-extensions.spec +++ b/nemo-extensions.spec @@ -4,13 +4,14 @@ Name: nemo-extensions Version: 6.0.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Extensions for Nemo License: GPLv2+ and LGPLv2 URL: https://github.com/linuxmint/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch0: %url/pull/512.patch +Patch1: %url/pull/514.patch ExcludeArch: %{ix86} @@ -326,6 +327,9 @@ rm -rf %{buildroot}/%{_datadir}/doc/nemo-python/ %{_mandir}/man1/nemo-seahorse-tool.1.* %changelog +* Tue Jan 30 2024 Leigh Scott - 6.0.1-5 +- Fix python NameError: '_' is not defined + * Thu Jan 25 2024 Fedora Release Engineering - 6.0.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild