[Xfce4-commits] [apps/catfish] 01/01: Simplify updates by centralizing values in catfishconfig.py; fix search index update button
noreply at xfce.org
noreply at xfce.org
Sat Dec 28 22:28:36 CET 2019
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/catfish.
commit 1744b20d66d51d20a7d84f160011176b55dcf264
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Dec 28 16:28:29 2019 -0500
Simplify updates by centralizing values in catfishconfig.py; fix search index update button
---
catfish/CatfishWindow.py | 26 +++++++++++++-------------
catfish_lib/__init__.py | 2 +-
catfish_lib/catfishconfig.py | 20 +++++++++++++++++++-
po/catfish.pot | 17 +++++++++++------
setup.py | 10 +++++-----
5 files changed, 49 insertions(+), 26 deletions(-)
diff --git a/catfish/CatfishWindow.py b/catfish/CatfishWindow.py
index 4b37a76..1351366 100644
--- a/catfish/CatfishWindow.py
+++ b/catfish/CatfishWindow.py
@@ -42,7 +42,7 @@ from gi.repository import GLib, GObject, Pango, Gdk, GdkPixbuf, Gtk
from catfish.CatfishPrefsDialog import CatfishPrefsDialog
from catfish.CatfishSearchEngine import CatfishSearchEngine
-from catfish_lib import catfishconfig, helpers, get_version
+from catfish_lib import catfishconfig, helpers, get_version, get_about
from catfish_lib import CatfishSettings, SudoDialog, Window
from catfish_lib import Thumbnailer
@@ -124,18 +124,18 @@ class CatfishWindow(Window):
search_in_progress = False
def get_about_dialog(self):
+ about = get_about()
+
dlg = GObject.new(Gtk.AboutDialog, use_header_bar=True)
- dlg.set_program_name(_("Catfish File Search"))
- dlg.set_version(get_version())
- dlg.set_logo_icon_name("catfish")
- dlg.set_website("https://docs.xfce.org/apps/catfish/start")
- dlg.set_comments(_("Catfish is a versatile file searching tool."))
+ dlg.set_program_name(about['program_name'])
+ dlg.set_version(about['version'])
+ dlg.set_logo_icon_name(about['icon_name'])
+ dlg.set_website(about['website'])
+ dlg.set_comments(about['comments'])
dlg.set_license_type(Gtk.License.GPL_2_0)
- dlg.set_copyright("Copyright (C) 2007-2012 Christian Dywan <christian at twotoasts.de>\n"
- "Copyright (C) 2012-2019 Sean Davis <bluesabre at xfce.org>")
- dlg.set_authors(["Christian Dywan <christian at twotoasts.de>",
- "Sean Davis <bluesabre at xfce.org>"])
- dlg.set_artists(["Nancy Runge <nancy at twotoasts.de>"])
+ dlg.set_copyright(about['copyright'])
+ dlg.set_authors(about['authors'])
+ dlg.set_artists(about['artists'])
dlg.set_translator_credits(_("translator-credits"))
dlg.set_transient_for(self)
@@ -751,7 +751,7 @@ class CatfishWindow(Window):
sudo_dialog = SudoDialog.SudoDialog(
parent=self.update_index_dialog,
icon='catfish',
- name=_("Catfish File Search"),
+ name=get_about()['program_name'],
retries=3)
sudo_dialog.show_all()
response = sudo_dialog.run()
@@ -794,7 +794,7 @@ class CatfishWindow(Window):
self.update_index_unlock.hide()
# Update the Cancel button to Close, make it default
- self.update_index_close.set_label(Gtk.STOCK_CLOSE)
+ self.update_index_close.set_label(_("Close"))
self.update_index_close.set_sensitive(True)
self.update_index_close.set_can_default(True)
self.update_index_close.set_receives_default(True)
diff --git a/catfish_lib/__init__.py b/catfish_lib/__init__.py
index 5a0cc1b..50e67c8 100644
--- a/catfish_lib/__init__.py
+++ b/catfish_lib/__init__.py
@@ -21,4 +21,4 @@
while keeping its api constant'''
from . helpers import set_up_logging, check_x11_session # noqa
from . Window import Window # noqa
-from . catfishconfig import get_version # noqa
+from . catfishconfig import get_version, get_about # noqa
diff --git a/catfish_lib/catfishconfig.py b/catfish_lib/catfishconfig.py
index afdc96b..e7652c7 100644
--- a/catfish_lib/catfishconfig.py
+++ b/catfish_lib/catfishconfig.py
@@ -30,8 +30,9 @@ __all__ = [
__catfish_data_directory__ = '../data/'
# Location of locate.db file
__locate_db_path__ = '/var/lib/mlocate/mlocate.db'
-__license__ = 'GPL-3+'
+__license__ = 'GPL-2+'
__version__ = '1.4.11'
+__url__ = 'https://docs.xfce.org/apps/catfish/start'
class project_path_not_found(Exception):
@@ -77,3 +78,20 @@ def get_locate_db_path():
def get_version():
"""Return the program version number."""
return __version__
+
+
+def get_about():
+ from locale import gettext as _
+
+ return {
+ 'version': __version__,
+ 'program_name': _('Catfish File Search'),
+ 'icon_name': 'catfish',
+ 'website': __url__,
+ 'comments': _('Catfish is a versatile file searching tool.'),
+ 'copyright': 'Copyright (C) 2007-2012 Christian Dywan <christian at twotoasts.de>\n'
+ 'Copyright (C) 2012-2019 Sean Davis <bluesabre at xfce.org>',
+ 'authors': ['Christian Dywan <christian at twotoasts.de>',
+ 'Sean Davis <bluesabre at xfce.org>'],
+ 'artists': ['Nancy Runge <nancy at twotoasts.de>']
+ }
\ No newline at end of file
diff --git a/po/catfish.pot b/po/catfish.pot
index 9e1aa58..3a2d884 100644
--- a/po/catfish.pot
+++ b/po/catfish.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-12-28 07:17-0500\n"
+"POT-Creation-Date: 2019-12-28 16:24-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: ../org.xfce.Catfish.desktop.in.h:1 ../data/ui/CatfishWindow.ui.h:28
-#: ../catfish/CatfishWindow.py:128 ../catfish/CatfishWindow.py:754
+#: ../catfish_lib/catfishconfig.py:88
msgid "Catfish File Search"
msgstr ""
@@ -344,10 +344,6 @@ msgstr ""
msgid "%s (invalid encoding)"
msgstr ""
-#: ../catfish/CatfishWindow.py:132
-msgid "Catfish is a versatile file searching tool."
-msgstr ""
-
#: ../catfish/CatfishWindow.py:139
msgid "translator-credits"
msgstr ""
@@ -383,6 +379,11 @@ msgstr ""
msgid "Search database updated successfully."
msgstr ""
+#. Update the Cancel button to Close, make it default
+#: ../catfish/CatfishWindow.py:797
+msgid "Close"
+msgstr ""
+
#. Set the dialog status to running.
#: ../catfish/CatfishWindow.py:811
msgid "Updating..."
@@ -505,6 +506,10 @@ msgstr ""
msgid "Search results for \"%s\""
msgstr ""
+#: ../catfish_lib/catfishconfig.py:91
+msgid "Catfish is a versatile file searching tool."
+msgstr ""
+
#: ../catfish_lib/SudoDialog.py:138
msgid "Password Required"
msgstr ""
diff --git a/setup.py b/setup.py
index dbd982a..fce5f53 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ import shutil
import sys
import subprocess
-release_version = '1.4.11'
+from catfish_lib.catfishconfig import __version__, __url__
try:
import DistUtilsExtra.auto
@@ -197,7 +197,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
os.remove(metainfo)
# Verify the build directory is clean
-folder = "dist/catfish-%s" % release_version
+folder = "dist/catfish-%s" % __version__
if os.path.exists(folder):
sys.stderr.write("Build directory 'dist' is not clean.\n"
"Please manually remove %s" % folder)
@@ -212,7 +212,7 @@ if "sdist" in sys.argv:
DistUtilsExtra.auto.setup(
name='catfish',
- version=release_version,
+ version=__version__,
license='GPL-2+',
author='Sean Davis',
author_email='bluesabre at xfce.org',
@@ -221,7 +221,7 @@ DistUtilsExtra.auto.setup(
'UNIX. The interface is intentionally lightweight and '
'simple, using only Gtk+3. You can configure it to your '
'needs by using several command line options.',
- url='https://docs.xfce.org/apps/catfish/start',
+ url=__url__,
data_files=[
('share/man/man1', ['catfish.1']),
('share/metainfo/', ['data/metainfo/catfish.appdata.xml'])
@@ -234,7 +234,7 @@ if default_release_build:
import hashlib
import tarfile
- bzfile = "dist/catfish-%s.tar.bz2" % release_version
+ bzfile = "dist/catfish-%s.tar.bz2" % __version__
if not os.path.exists(bzfile):
sys.stderr.write("Expected file '%s' was not found.")
sys.exit(1)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list