~attente/ubuntu/saucy/ibus-anthy/move-typelib

« back to all changes in this revision

Viewing changes to setup/prefs.py

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2010-01-24 16:17:50 UTC
  • mfrom: (1.1.6 upstream) (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100124161750-375hsq4iy9j75gkl
* New upstream release.
  - fix convert_to_half do same as convert_to_half_katakana (LP: #475031) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:set noet ts=4:
 
2
#
 
3
# ibus-anthy - The Anthy engine for IBus
 
4
#
 
5
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
 
6
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
 
7
# Copyright (c) 2007-2010 Red Hat, Inc.
 
8
#
 
9
# This program is free software; you can redistribute it and/or modify
 
10
# it under the terms of the GNU General Public License as published by
 
11
# the Free Software Foundation; either version 2, or (at your option)
 
12
# any later version.
 
13
#
 
14
# This program is distributed in the hope that it will be useful,
 
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
# GNU General Public License for more details.
 
18
#
 
19
# You should have received a copy of the GNU General Public License
 
20
# along with this program; if not, write to the Free Software
 
21
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
 
1
23
from ibus import Bus
2
24
 
3
25
 
40
62
        for k in self.keys(section):
41
63
            self.fetch_item(section, k)
42
64
 
43
 
    def fetch_item(self, section, key):
 
65
    def fetch_item(self, section, key, readonly=False):
44
66
        s = '/'.join(
45
67
            [s for s in '/'.join([self._prefix, section]).split('/') if s])
46
68
        v = self._config.get_value(s, key, None)
 
69
        if readonly:
 
70
            return v != None
47
71
        if v != None:
48
72
            self.modified.setdefault(section, {})[key] = v if v != [''] else []
 
73
        return True
49
74
 
50
75
    def commit_all(self):
51
76
        for s in self.new.keys():