[Xfce4-commits] [apps/xfce4-panel-profiles] 01/02: Tidy up some pylint notices

noreply at xfce.org noreply at xfce.org
Sat Jul 14 12:36:01 CEST 2018


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/xfce4-panel-profiles.

commit 920dd8c819e4d50ac7c008fb8d7fbb2a65212b1a
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Jul 14 06:35:30 2018 -0400

    Tidy up some pylint notices
---
 xfce4-panel-profiles/panelconfig.py          | 12 +++++++-----
 xfce4-panel-profiles/xfce4-panel-profiles.py |  8 +++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xfce4-panel-profiles/panelconfig.py b/xfce4-panel-profiles/panelconfig.py
index 031e985..5f85f20 100644
--- a/xfce4-panel-profiles/panelconfig.py
+++ b/xfce4-panel-profiles/panelconfig.py
@@ -42,7 +42,8 @@ class PanelConfig(object):
         self.properties = {}
         self.source = None
 
-    def from_xfconf(xfconf):
+    @classmethod
+    def from_xfconf(cls, xfconf):
         pc = PanelConfig()
 
         result = xfconf.call_sync(
@@ -68,7 +69,8 @@ class PanelConfig(object):
 
         return pc
 
-    def from_file(filename):
+    @classmethod
+    def from_file(cls, filename):
         pc = PanelConfig()
 
         pc.source = tarfile.open(filename, mode='r')
@@ -213,11 +215,11 @@ class PanelConfig(object):
             try:
                 xfconf.call_sync('ResetProperty', GLib.Variant(
                     '(ssb)', ('xfce4-panel', '/', True)), 0, -1, None)
-            except GLib.Error:
+            except GLib.Error:  # pylint: disable=E0712
                 pass
 
             for (pp, pv) in sorted(self.properties.items()):
-                result = xfconf.call_sync('SetProperty', GLib.Variant(
+                xfconf.call_sync('SetProperty', GLib.Variant(
                     '(ssv)', ('xfce4-panel', pp, pv)), 0, -1, None)
 
             panel_path = os.path.join(
@@ -231,5 +233,5 @@ class PanelConfig(object):
 
             try:
                 dbus_proxy.call_sync('Terminate', GLib.Variant('(b)', ('xfce4-panel',)), 0, -1, None)
-            except GLib.GError:
+            except GLib.GError:  # pylint: disable=E0712
                 pass
diff --git a/xfce4-panel-profiles/xfce4-panel-profiles.py b/xfce4-panel-profiles/xfce4-panel-profiles.py
index fb0a068..7021dc5 100644
--- a/xfce4-panel-profiles/xfce4-panel-profiles.py
+++ b/xfce4-panel-profiles/xfce4-panel-profiles.py
@@ -154,12 +154,11 @@ class XfcePanelProfiles:
             results.append((cachefile, _("Current Configuration"), now))
         else:
             results.append(("", _("Current Configuration"), now))
-        today_delta = datetime.datetime.today() - datetime.timedelta(days=1)
 
         for directory in self.get_data_dirs():
             for filename in os.listdir(directory):
                 name, ext = os.path.splitext(filename)
-                name, tar = os.path.splitext(name)
+                name = os.path.splitext(name)[0]
                 if ext in [".gz", ".bz2"]:
                     path = os.path.join(directory, filename)
                     t = int(os.path.getmtime(path))
@@ -187,12 +186,12 @@ class XfcePanelProfiles:
         return (model, treeiter, values)
 
     def get_selected_filename(self):
-        model, treeiter, values = self.get_selected()
+        values = self.get_selected()[2]
         filename = values[0]
         return filename
 
     def copy_configuration(self, row, new_name, append=True):
-        model, treeiter, values = row
+        values = row[2]
         filename = values[0]
         old_name = values[1]
         created = values[2]
@@ -299,7 +298,6 @@ class PanelSaveDialog(Gtk.MessageDialog):
 
     def __init__(self, parent=None, default=None):
         primary = _("Name the new panel configuration")
-        secondary = ""
         Gtk.MessageDialog.__init__(
             self, transient_for=parent, modal=True,
             message_type=Gtk.MessageType.QUESTION,

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


More information about the Xfce4-commits mailing list