[pitivi] settings: Fix notifiesConfigOption
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] settings: Fix notifiesConfigOption
- Date: Fri, 23 Oct 2015 17:11:13 +0000 (UTC)
commit 51ea760e94d12b44dddadabda343c4aa1c1cd1c2
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Thu Oct 22 16:20:48 2015 +0200
settings: Fix notifiesConfigOption
Differential Revision: https://phabricator.freedesktop.org/D432
pitivi/settings.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 42fdbd0..1c26c24 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -20,7 +20,7 @@
# Boston, MA 02110-1301, USA.
import os
-from configparser import ConfigParser, ParsingError
+import configparser
from gi.repository import GLib
from gi.repository import GObject
@@ -146,7 +146,7 @@ class GlobalSettings(GObject.Object, Loggable):
Loggable.__init__(self)
self.conf_file_path = os.path.join(xdg_config_home(), "pitivi.conf")
- self._config = ConfigParser()
+ self._config = configparser.ConfigParser()
self._readSettingsFromConfigurationFile()
self._readSettingsFromEnvironmentVariables()
@@ -161,7 +161,7 @@ class GlobalSettings(GObject.Object, Loggable):
self.error("Failed to read %s: %s", self.conf_file_path, e)
unicode_error_dialog()
return
- except ParsingError as e:
+ except configparser.ParsingError as e:
self.error("Failed to parse %s: %s", self.conf_file_path, e)
return
@@ -337,5 +337,8 @@ class GlobalSettings(GObject.Object, Loggable):
@classmethod
def notifiesConfigOption(cls, attrname):
+ """
+ Whether a changed signal is emitted for the specified setting.
+ """
signal_name = Notification.signalName(attrname)
- GObject.signal_lookup(signal_name, cls)
+ return bool(GObject.signal_lookup(signal_name, cls))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]