summaryrefslogtreecommitdiff
path: root/caribou/ui/window.py
diff options
context:
space:
mode:
authorDaniel Baeyens <dbaeyens@warp.es>2010-06-20 15:48:21 +0200
committerEitan Isaacson <eitan@monotonous.org>2010-06-21 09:34:11 -0700
commit9be34af3f81ed10834ab9c7039a2b254c0b5d862 (patch)
treed8d2dc3f1fce155643a0700926f32c654b33f52a /caribou/ui/window.py
parent8520b351b86c1466c740b2347d3dc23e0daa80b7 (diff)
downloadcaribou-9be34af3f81ed10834ab9c7039a2b254c0b5d862.tar.gz
Fixes the checks of existing layouts
With new json backend, the way to autodetect layouts has changed. It tries looking for .json files and then for .xml ones, but if the configuration has the suffix already, then fails and do not load anything. Now, it first checks if the configured layout exists. If not, then it fallbacks to the standard autodetection https://bugzilla.gnome.org/show_bug.cgi?id=622221
Diffstat (limited to 'caribou/ui/window.py')
-rw-r--r--caribou/ui/window.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/caribou/ui/window.py b/caribou/ui/window.py
index d881439..72647a2 100644
--- a/caribou/ui/window.py
+++ b/caribou/ui/window.py
@@ -3,6 +3,8 @@
# Caribou - text entry and UI navigation application
#
# Copyright (C) 2009 Eitan Isaacson <eitan@monotonous.org>
+# Copyright (C) 2010 Warp Networks S.L.
+# * Contributor: Daniel Baeyens <dbaeyens@warp.es>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
@@ -139,15 +141,18 @@ class CaribouWindow(gtk.Window):
or "qwerty"
conf_file_path = os.path.join(data_path, CARIBOU_LAYOUT_DIR, layout)
- json_path = '%s.json' % conf_file_path
+ if os.path.exists(conf_file_path):
+ return conf_file_path
+ else:
+ json_path = '%s.json' % conf_file_path
- if os.path.exists(json_path):
- return json_path
+ if os.path.exists(json_path):
+ return json_path
- xml_path = '%s.xml' % conf_file_path
+ xml_path = '%s.xml' % conf_file_path
- if os.path.exists(xml_path):
- return xml_path
+ if os.path.exists(xml_path):
+ return xml_path
def show_all(self):