summaryrefslogtreecommitdiffstats
path: root/gconf
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-07-28 11:37:17 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-07-28 11:37:17 +0800
commit9ff51991372df5700b8d4e706cd33a3e92c3b0d5 (patch)
tree16ac218edb374acc454cd83ed978c1894ff4e443 /gconf
parent0dc44f16c8cc65e9beaec20230e0bcbec5758bb8 (diff)
downloadibus-9ff51991372df5700b8d4e706cd33a3e92c3b0d5.tar.gz
ibus-9ff51991372df5700b8d4e706cd33a3e92c3b0d5.tar.xz
ibus-9ff51991372df5700b8d4e706cd33a3e92c3b0d5.zip
Refine coding style.
Diffstat (limited to 'gconf')
-rw-r--r--gconf/main.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/gconf/main.py b/gconf/main.py
index 76e08c5..cac23f3 100644
--- a/gconf/main.py
+++ b/gconf/main.py
@@ -2,12 +2,12 @@
#
# ibus - The Input Bus
#
-# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
+# Copyright(c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# This library 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 Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
+# version 2 of the License, or(at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -27,57 +27,57 @@ import config
import gtk
class GconfApplication:
- def __init__ (self):
+ def __init__(self):
self.__conn = ibus.Connection()
self.__conn.call_on_disconnection(self.__disconnected_cb)
- self.__ibus = self.__conn.get_ibus ()
- self.__config = config.ConfigProxy (self.__conn, "/org/freedesktop/IBus/Config", self.__ibus)
+ self.__ibus = self.__conn.get_ibus()
+ self.__config = config.ConfigProxy(self.__conn, "/org/freedesktop/IBus/Config", self.__ibus)
- self.__ibus.RegisterConfig (self.__config, True)
+ self.__ibus.RegisterConfig(self.__config, True)
- def run (self):
- gtk.main ()
+ def run(self):
+ gtk.main()
- def __disconnected_cb (self, conn):
+ def __disconnected_cb(self, conn):
print "disconnected"
- gtk.main_quit ()
+ gtk.main_quit()
-def launch_gconf ():
- # gtk.settings_get_default ().props.gtk_theme_name = "/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc"
- # gtk.rc_parse ("./themes/default/gtkrc")
- GconfApplication ().run ()
+def launch_gconf():
+ # gtk.settings_get_default().props.gtk_theme_name = "/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc"
+ # gtk.rc_parse("./themes/default/gtkrc")
+ GconfApplication().run()
-def print_help (out, v = 0):
+def print_help(out, v = 0):
print >> out, "-h, --help show this message."
print >> out, "-d, --daemonize daemonize ibus"
- sys.exit (v)
+ sys.exit(v)
-def main ():
+def main():
daemonize = False
shortopt = "hd"
longopt = ["help", "daemonize"]
try:
- opts, args = getopt.getopt (sys.argv[1:], shortopt, longopt)
+ opts, args = getopt.getopt(sys.argv[1:], shortopt, longopt)
except getopt.GetoptError, err:
- print_help (sys.stderr, 1)
+ print_help(sys.stderr, 1)
for o, a in opts:
if o in ("-h", "--help"):
- print_help (sys.stdout)
+ print_help(sys.stdout)
elif o in ("-d", "--daemonize"):
daemonize = True
else:
print >> sys.stderr, "Unknown argument: %s" % o
- print_help (sys.stderr, 1)
+ print_help(sys.stderr, 1)
if daemonize:
- if os.fork ():
- sys.exit ()
+ if os.fork():
+ sys.exit()
- launch_gconf ()
+ launch_gconf()
if __name__ == "__main__":
- main ()
+ main()