diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-15 11:27:53 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-15 11:27:53 +0800 |
| commit | f92cd418e57c2a75936acdb11eaa9d26b3037c56 (patch) | |
| tree | 689b78cd475d43602f31b6ca6131a5ad86619e1c /daemon/enginefactory.py | |
| parent | 0379f83eab1863249f0633383376ec2a8cdbedd6 (diff) | |
| download | ibus-f92cd418e57c2a75936acdb11eaa9d26b3037c56.tar.gz ibus-f92cd418e57c2a75936acdb11eaa9d26b3037c56.tar.xz ibus-f92cd418e57c2a75936acdb11eaa9d26b3037c56.zip | |
Refine coding style of enginefactory.py
Diffstat (limited to 'daemon/enginefactory.py')
| -rw-r--r-- | daemon/enginefactory.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/daemon/enginefactory.py b/daemon/enginefactory.py index 24ce857..6f507aa 100644 --- a/daemon/enginefactory.py +++ b/daemon/enginefactory.py @@ -24,57 +24,57 @@ import gobject import ibus from engine import Engine -class EngineFactory (ibus.Object): - def __init__ (self, ibusconn, object_path): - ibus.Object.__init__ (self) +class EngineFactory(ibus.Object): + def __init__(self, ibusconn, object_path): + super(EngineFactory, self).__init__() self._ibusconn = ibusconn self._object_path = object_path - self._factory = self._ibusconn.get_object (self._object_path) + self._factory = self._ibusconn.get_object(self._object_path) - self._ibusconn.connect ("destroy", self._ibusconn_destroy_cb) + self._ibusconn.connect("destroy", self._ibusconn_destroy_cb) - self._ibusconn.connect ("dbus-signal", self._dbus_signal_cb) - self._engines = weakref.WeakValueDictionary () + self._ibusconn.connect("dbus-signal", self._dbus_signal_cb) + self._engines = weakref.WeakValueDictionary() self._info = None - def get_object_path (self): + def get_object_path(self): return self._object_path - def get_info (self): + def get_info(self): if self._info == None: - self._info = self._factory.GetInfo () + self._info = self._factory.GetInfo() return self._info - def create_engine (self): - object_path = self._factory.CreateEngine () - engine = Engine (self, self._ibusconn, object_path) + def create_engine(self): + object_path = self._factory.CreateEngine() + engine = Engine(self, self._ibusconn, object_path) self._engines[object_path] = engine return engine - def destroy (self): - ibus.Object.destroy (self) + def destroy(self): + ibus.Object.destroy(self) self._ibusconn = None self._factory = None - def _ibusconn_destroy_cb (self, ibusconn): - self.destroy () + def _ibusconn_destroy_cb(self, ibusconn): + self.destroy() - def _dbus_signal_cb (self, ibusconn, message): - object_path = message.get_path () + def _dbus_signal_cb(self, ibusconn, message): + object_path = message.get_path() if object_path in self._engines: - self._engines[object_path].handle_dbus_signal (message) + self._engines[object_path].handle_dbus_signal(message) # methods for cmp - def __lt__ (self, other): - x = self.get_info () - y = other.get_info () + def __lt__(self, other): + x = self.get_info() + y = other.get_info() if x[1] < y[1]: return True if x[1] == y[1]: return x[0] < y[0] - def __gt__ (self, other): - x = self.get_info () - y = other.get_info () + def __gt__(self, other): + x = self.get_info() + y = other.get_info() if x[1] > y[1]: return True if x[1] == y[1]: return x[0] > y[0] |
