[Xfce4-commits] [apps/catfish] 01/01: Handle permission errors in settings handler (bug #14488)

noreply at xfce.org noreply at xfce.org
Sat Jun 30 04:38:18 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/catfish.

commit 7acb5b2863eab7d620b4401b64776bedf91b7839
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Jun 29 22:38:11 2018 -0400

    Handle permission errors in settings handler (bug #14488)
---
 catfish_lib/CatfishSettings.py | 21 ++++++++++++---------
 po/catfish.pot                 |  2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/catfish_lib/CatfishSettings.py b/catfish_lib/CatfishSettings.py
index ce2c6b0..7406a8a 100644
--- a/catfish_lib/CatfishSettings.py
+++ b/catfish_lib/CatfishSettings.py
@@ -74,12 +74,15 @@ class CatfishSettings:
     def write(self):
         """Write the current settings to the settings rc-file."""
         if self.settings_file:
-            write_file = open(self.settings_file, 'w')
-            for key in list(self.settings.keys()):
-                value = self.settings[key]
-                if isinstance(value, bool):
-                    value = str(value).lower()
-                else:
-                    value = str(value)
-                write_file.write('%s=%s\n' % (key, value))
-            write_file.close()
+            try:
+                write_file = open(self.settings_file, 'w')
+                for key in list(self.settings.keys()):
+                    value = self.settings[key]
+                    if isinstance(value, bool):
+                        value = str(value).lower()
+                    else:
+                        value = str(value)
+                    write_file.write('%s=%s\n' % (key, value))
+                write_file.close()
+            except PermissionError:
+                pass
diff --git a/po/catfish.pot b/po/catfish.pot
index cc199d7..89f53d5 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: 2018-06-29 22:28-0400\n"
+"POT-Creation-Date: 2018-06-29 22:37-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"

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


More information about the Xfce4-commits mailing list