diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-11 17:48:49 +0800 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-11 17:48:49 +0800 |
commit | 6d7f49c57e7013dabcd88c810eaa2fc49f94c87d (patch) | |
tree | 78991497b796e5e05b59a5d254ac7cdc2428ffa7 /ibus | |
parent | 064eb48804f34f1c2249d93b5df4b129d536febd (diff) |
Do not hardcode iso-codes anymore
Diffstat (limited to 'ibus')
-rw-r--r-- | ibus/_config.py.in | 5 | ||||
-rw-r--r-- | ibus/lang.py | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ibus/_config.py.in b/ibus/_config.py.in index 6e3c1dfa..5aa4bd04 100644 --- a/ibus/_config.py.in +++ b/ibus/_config.py.in @@ -23,7 +23,8 @@ __all__ = ( "get_version", "get_copyright", - "get_license" + "get_license", + "ISOCODES_PREFIX" ) import gettext @@ -39,3 +40,5 @@ Copyright (c) 2007-2010 Red Hat, Inc.''') def get_license(): return 'LGPL' + +ISOCODES_PREFIX='@ISOCODES_PREFIX@' diff --git a/ibus/lang.py b/ibus/lang.py index eb1b4db5..705ef70f 100644 --- a/ibus/lang.py +++ b/ibus/lang.py @@ -60,7 +60,9 @@ def __char_data(data): pass def __load_lang(): - iso_639_xml = "/usr/share/xml/iso-codes/iso_639.xml" + import os + import _config + iso_639_xml = os.path.join(_config.ISOCODES_PREFIX, "share/xml/iso-codes/iso_639.xml") p = xml.parsers.expat.ParserCreate() p.StartElementHandler = __start_element p.EndElementHandler = __end_element |