[orca] Get back to first start if config file is in old yaml format
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Get back to first start if config file is in old yaml format
- Date: Tue, 8 Feb 2011 03:49:51 +0000 (UTC)
commit a542c9b797f65fc300f44614da75caa350e26b15
Author: Javier Hernández Antúnez <jhernandez emergya es>
Date: Sun Feb 6 05:31:28 2011 +0100
Get back to first start if config file is in old yaml format
src/orca/backends/json_backend.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/backends/json_backend.py b/src/orca/backends/json_backend.py
index 681f20d..f5b6477 100644
--- a/src/orca/backends/json_backend.py
+++ b/src/orca/backends/json_backend.py
@@ -2,7 +2,7 @@
#
# Copyright 2010-2011 Consorcio Fernando de los Rios.
# Author: Juanje Ojeda Croissier <jojeda emergya es>
-# Author: Javier Hernández Antúnez <jhernandez emergya es>
+# Author: Javier Hernandez Antunez <jhernandez emergya es>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -85,7 +85,10 @@ class Backend:
def _getSettings(self):
""" Load from config file all settings """
settingsFile = open(self.settingsFile)
- prefs = load(settingsFile)
+ try:
+ prefs = load(settingsFile)
+ except ValueError:
+ return
self.general = prefs['general'].copy()
self.pronunciations = prefs['pronunciations']
self.keybindings = prefs['keybindings']
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]