| OLD | NEW |
| 1 # vim:set et sts=4 sw=4: | 1 # vim:set et sts=4 sw=4: |
| 2 # | 2 # |
| 3 # ibus - The Input Bus | 3 # ibus - The Input Bus |
| 4 # | 4 # |
| 5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com> | 5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com> |
| 6 # Copyright (c) 2007-2010 Red Hat, Inc. | 6 # Copyright (c) 2007-2010 Red Hat, Inc. |
| 7 # | 7 # |
| 8 # This library is free software; you can redistribute it and/or | 8 # This library is free software; you can redistribute it and/or |
| 9 # modify it under the terms of the GNU Lesser General Public | 9 # modify it under the terms of the GNU Lesser General Public |
| 10 # License as published by the Free Software Foundation; either | 10 # License as published by the Free Software Foundation; either |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 def get_value(self, section, name): | 43 def get_value(self, section, name): |
| 44 pass | 44 pass |
| 45 | 45 |
| 46 def set_value(self, section, name, value): | 46 def set_value(self, section, name, value): |
| 47 pass | 47 pass |
| 48 | 48 |
| 49 def unset(self, section, name): | 49 def unset(self, section, name): |
| 50 pass | 50 pass |
| 51 | 51 |
| 52 def get_unused(self, unread, unwritten): |
| 53 pass |
| 54 |
| 52 def value_changed(self, section, name, value): | 55 def value_changed(self, section, name, value): |
| 53 self.__proxy.ValueChanged(section, name, value) | 56 self.__proxy.ValueChanged(section, name, value) |
| 54 | 57 |
| 55 | 58 |
| 56 class ConfigProxy(interface.IConfig): | 59 class ConfigProxy(interface.IConfig): |
| 57 def __init__ (self, config, dbusconn): | 60 def __init__ (self, config, dbusconn): |
| 58 super(ConfigProxy, self).__init__(dbusconn, IBUS_PATH_CONFIG) | 61 super(ConfigProxy, self).__init__(dbusconn, IBUS_PATH_CONFIG) |
| 59 self.__dbusconn = dbusconn | 62 self.__dbusconn = dbusconn |
| 60 self.__config = config | 63 self.__config = config |
| 61 | 64 |
| 62 def GetValue(self, section, name): | 65 def GetValue(self, section, name): |
| 63 return self.__config.get_value(section, name) | 66 return self.__config.get_value(section, name) |
| 64 | 67 |
| 65 def SetValue(self, section, name, value): | 68 def SetValue(self, section, name, value): |
| 66 return self.__config.set_value(section, name, value) | 69 return self.__config.set_value(section, name, value) |
| 67 | 70 |
| 68 def Unset(self, section, name): | 71 def Unset(self, section, name): |
| 69 return self.__config.unset(section, name) | 72 return self.__config.unset(section, name) |
| 70 | 73 |
| 74 def GetUnused(self, unread, unwritten): |
| 75 return self.__config.get_unused(unread, unwritten) |
| 76 |
| 71 def Destroy(self): | 77 def Destroy(self): |
| 72 self.__config.destroy() | 78 self.__config.destroy() |
| 73 | 79 |
| 74 class Config(object.Object): | 80 class Config(object.Object): |
| 75 __gtype_name__ = "PYIBusConfig" | 81 __gtype_name__ = "PYIBusConfig" |
| 76 __gsignals__ = { | 82 __gsignals__ = { |
| 77 "reloaded" : ( | 83 "reloaded" : ( |
| 78 gobject.SIGNAL_RUN_LAST, | 84 gobject.SIGNAL_RUN_LAST, |
| 79 gobject.TYPE_NONE, | 85 gobject.TYPE_NONE, |
| 80 () | 86 () |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return self.__config.GetValue(section, name) | 143 return self.__config.GetValue(section, name) |
| 138 except: | 144 except: |
| 139 return default_value | 145 return default_value |
| 140 | 146 |
| 141 def set_value(self, section, name, value): | 147 def set_value(self, section, name, value): |
| 142 try: | 148 try: |
| 143 return self.__config.SetValue(section, name, value) | 149 return self.__config.SetValue(section, name, value) |
| 144 except: | 150 except: |
| 145 return | 151 return |
| 146 | 152 |
| 153 def get_unused(self, unread, unwritten): |
| 154 try: |
| 155 return self.__config.GetUnused(unread, unwritten) |
| 156 except: |
| 157 return |
| 158 |
| 147 def set_list(self, section, name, value, signature): | 159 def set_list(self, section, name, value, signature): |
| 148 return self.set_value(section, name, dbus.Array(value, signature=signatu
re)) | 160 return self.set_value(section, name, dbus.Array(value, signature=signatu
re)) |
| 149 | 161 |
| 150 def unset(self, section, name): | 162 def unset(self, section, name): |
| 151 try: | 163 try: |
| 152 return self.__config.Unset(section, name) | 164 return self.__config.Unset(section, name) |
| 153 except: | 165 except: |
| 154 return | 166 return |
| OLD | NEW |