[Xfce4-commits] [apps/catfish] 01/01: Various pylint improvements

noreply at xfce.org noreply at xfce.org
Sat Aug 24 19:16:21 CEST 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 c3e2a1a45ae1e1dbccef6960b8a088853d54f49f
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Aug 24 13:16:16 2019 -0400

    Various pylint improvements
---
 catfish/AboutCatfishDialog.py  |  2 +-
 catfish/CatfishSearchEngine.py |  2 +-
 catfish/CatfishWindow.py       | 22 ++++++-------
 catfish_lib/Window.py          |  6 ++++
 po/catfish.pot                 | 70 +++++++++++++++++++++---------------------
 5 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/catfish/AboutCatfishDialog.py b/catfish/AboutCatfishDialog.py
index 9321e5b..aeb76d3 100644
--- a/catfish/AboutCatfishDialog.py
+++ b/catfish/AboutCatfishDialog.py
@@ -31,7 +31,7 @@ class AboutCatfishDialog(AboutDialog):
     """Creates the about dialog for catfish"""
     __gtype_name__ = "AboutCatfishDialog"
 
-    def finish_initializing(self, builder):  # pylint: disable=E1002
+    def finish_initializing(self, builder):
         """Set up the about dialog"""
         super(AboutCatfishDialog, self).finish_initializing(builder)
         self.set_translator_credits(_("translator-credits"))
diff --git a/catfish/CatfishSearchEngine.py b/catfish/CatfishSearchEngine.py
index 9e9ec0c..63dc566 100644
--- a/catfish/CatfishSearchEngine.py
+++ b/catfish/CatfishSearchEngine.py
@@ -488,7 +488,7 @@ class CatfishSearchMethodExternal(CatfishSearchMethod):
 
     def assemble_query(self, keywords, path):
         """Base assemble_query method."""
-        return None
+        return False
 
     def run(self, keywords, path, regex=False):
         """Run the search method using keywords and path.
diff --git a/catfish/CatfishWindow.py b/catfish/CatfishWindow.py
index 76e7c1f..7db3b2b 100644
--- a/catfish/CatfishWindow.py
+++ b/catfish/CatfishWindow.py
@@ -124,7 +124,7 @@ class CatfishWindow(Window):
     mimetypes = dict()
     search_in_progress = False
 
-    def finish_initializing(self, builder):  # pylint: disable=E1002
+    def finish_initializing(self, builder):
         """Set up the main window"""
         super(CatfishWindow, self).finish_initializing(builder)
         self.set_wmclass("Catfish", "Catfish")
@@ -249,7 +249,7 @@ class CatfishWindow(Window):
 
             now = datetime.datetime.now()
             self.today = datetime.datetime(now.year, now.month, now.day)
-            locate, locate_path, locate_date = self.check_locate()[:3]
+            locate_path, locate_date = self.check_locate()[1:3]
 
             self.update_index_database.set_label("<tt>%s</tt>" % locate_path)
             if not os.access(os.path.dirname(locate_path), os.R_OK):
@@ -577,7 +577,7 @@ class CatfishWindow(Window):
                 icon_name = None
             else:
                 # Get the mimetype image..
-                mimetype, override = self.guess_mimetype(filename)
+                mimetype = self.guess_mimetype(filename)[0]
                 icon_name = self.get_file_icon(filename, mimetype)
 
         if icon_name is not None:
@@ -588,8 +588,7 @@ class CatfishWindow(Window):
 
     def thumbnail_cell_data_func(self, col, renderer, model, treeiter, data):
         """Cell Renderer Function to Thumbnails View."""
-        icon, name, size, path, modified, mime, hidden, exact = \
-            model[treeiter][:]
+        name, size, path, modified = model[treeiter][1:4]
         name = escape(name)
         size = self.format_size(size)
         path = escape(path)
@@ -742,7 +741,7 @@ class CatfishWindow(Window):
                 done = False
             if done:
                 self.update_index_active = False
-                locate, locate_path, locate_date, changed = self.check_locate()
+                locate_date, changed = self.check_locate()[2:]
                 modified = locate_date.strftime("%x %X")
                 self.update_index_modified.set_label("<tt>%s</tt>" % modified)
 
@@ -883,7 +882,7 @@ class CatfishWindow(Window):
 
         for filename in self.suggestions_engine.run(keywords, folder, 10):
             if isinstance(filename, str):
-                path, name = os.path.split(filename)
+                name = os.path.split(filename)[1]
                 if name not in results:
                     try:
                         # Determine if file is hidden
@@ -1341,8 +1340,7 @@ class CatfishWindow(Window):
     def check_treeview_stats(self, treeview):
         if len(self.rows) == 0:
             return -1
-        model, rows, selected_filenames = \
-            self.treeview_get_selected_rows(treeview)
+        rows = self.treeview_get_selected_rows(treeview)[1]
         for row in rows:
             if row not in self.rows:
                 return 2
@@ -1355,8 +1353,8 @@ class CatfishWindow(Window):
             self.treeview_set_cursor_if_unset(treeview,
                                               int(event.x),
                                               int(event.y))
-        model, self.rows, self.selected_filenames = \
-            self.treeview_get_selected_rows(treeview)
+        self.rows, self.selected_filenames = \
+            self.treeview_get_selected_rows(treeview)[1:]
 
     def maintain_treeview_stats(self, treeview, event=None):
         if len(self.selected_filenames) == 0:
@@ -1780,7 +1778,7 @@ class CatfishWindow(Window):
                     # file no longer exists
                     pass
                 except Exception as e:
-                    logger.error("Exception encountered: ", str(e))
+                    logger.error("Exception encountered: %s" % str(e))
 
             yield True
             continue
diff --git a/catfish_lib/Window.py b/catfish_lib/Window.py
index d2add9b..4f78c3a 100644
--- a/catfish_lib/Window.py
+++ b/catfish_lib/Window.py
@@ -210,6 +210,12 @@ class Window(Gtk.Window):
         search.grab_focus()
         self.keys_pressed = []
 
+        self.search_engine = None
+        self.settings = None
+
+    def on_sidebar_toggle_toggled(self, widget):
+        pass
+
     def setup_headerbar(self, chooser, search, button):
         headerbar = Gtk.HeaderBar.new()
         headerbar.set_show_close_button(True)
diff --git a/po/catfish.pot b/po/catfish.pot
index a20e639..ccd5baa 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-08-24 12:40-0400\n"
+"POT-Creation-Date: 2019-08-24 13:13-0400\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:712
+#: ../catfish/CatfishWindow.py:711
 msgid "Catfish File Search"
 msgstr ""
 
@@ -121,7 +121,7 @@ msgstr ""
 msgid "<b>End Date</b>"
 msgstr ""
 
-#: ../data/ui/CatfishWindow.ui.h:23 ../catfish_lib/Window.py:218
+#: ../data/ui/CatfishWindow.ui.h:23 ../catfish_lib/Window.py:224
 msgid "Catfish"
 msgstr ""
 
@@ -137,11 +137,11 @@ msgstr ""
 msgid "File Type"
 msgstr ""
 
-#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1254
+#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1253
 msgid "Modified"
 msgstr ""
 
-#: ../data/ui/CatfishWindow.ui.h:29 ../catfish/CatfishWindow.py:1702
+#: ../data/ui/CatfishWindow.ui.h:29 ../catfish/CatfishWindow.py:1700
 msgid "Results will be displayed as soon as they are found."
 msgstr ""
 
@@ -285,140 +285,140 @@ msgid ""
 "or click the %s icon for more options."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:680
+#: ../catfish/CatfishWindow.py:679
 msgid "An error occurred while updating the database."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:682
+#: ../catfish/CatfishWindow.py:681
 msgid "Authentication failed."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:688
+#: ../catfish/CatfishWindow.py:687
 msgid "Authentication cancelled."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:694
+#: ../catfish/CatfishWindow.py:693
 msgid "Search database updated successfully."
 msgstr ""
 
 #. Set the dialog status to running.
-#: ../catfish/CatfishWindow.py:769
+#: ../catfish/CatfishWindow.py:768
 msgid "Updating..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:803
+#: ../catfish/CatfishWindow.py:802
 msgid "Stop Search"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:804
+#: ../catfish/CatfishWindow.py:803
 msgid ""
 "Search is in progress...\n"
 "Press the cancel button or the Escape key to stop."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:813
+#: ../catfish/CatfishWindow.py:812
 msgid "Begin Search"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1074
+#: ../catfish/CatfishWindow.py:1073
 #, python-format
 msgid "\"%s\" could not be opened."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1126
+#: ../catfish/CatfishWindow.py:1125
 #, python-format
 msgid "\"%s\" could not be saved."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1143
+#: ../catfish/CatfishWindow.py:1142
 #, python-format
 msgid "\"%s\" could not be deleted."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1183
+#: ../catfish/CatfishWindow.py:1182
 #, python-format
 msgid "Save \"%s\" as..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1218
+#: ../catfish/CatfishWindow.py:1217
 #, python-format
 msgid ""
 "Are you sure that you want to \n"
 "permanently delete \"%s\"?"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1222
+#: ../catfish/CatfishWindow.py:1221
 #, python-format
 msgid ""
 "Are you sure that you want to \n"
 "permanently delete the %i selected files?"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1225
+#: ../catfish/CatfishWindow.py:1224
 msgid "If you delete a file, it is permanently lost."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1248
+#: ../catfish/CatfishWindow.py:1247
 msgid "Filename"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1250
+#: ../catfish/CatfishWindow.py:1249
 msgid "Size"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1252
+#: ../catfish/CatfishWindow.py:1251
 msgid "Location"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1264
+#: ../catfish/CatfishWindow.py:1263
 msgid "Preview"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1272
+#: ../catfish/CatfishWindow.py:1271
 msgid "Details"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1492
+#: ../catfish/CatfishWindow.py:1490
 msgid "Today"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1494
+#: ../catfish/CatfishWindow.py:1492
 msgid "Yesterday"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1575
+#: ../catfish/CatfishWindow.py:1573
 msgid "No files found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1577
+#: ../catfish/CatfishWindow.py:1575
 msgid ""
 "Try making your search less specific\n"
 "or try another directory."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1584
+#: ../catfish/CatfishWindow.py:1582
 msgid "1 file found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1586
+#: ../catfish/CatfishWindow.py:1584
 #, python-format
 msgid "%i files found."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1592
+#: ../catfish/CatfishWindow.py:1590
 msgid "bytes"
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1700 ../catfish/CatfishWindow.py:1710
+#: ../catfish/CatfishWindow.py:1698 ../catfish/CatfishWindow.py:1708
 msgid "Searching..."
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1708
+#: ../catfish/CatfishWindow.py:1706
 #, python-format
 msgid "Searching for \"%s\""
 msgstr ""
 
-#: ../catfish/CatfishWindow.py:1792
+#: ../catfish/CatfishWindow.py:1790
 #, python-format
 msgid "Search results for \"%s\""
 msgstr ""

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list