summaryrefslogtreecommitdiffstats
path: root/launcher
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-09 08:30:10 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-09 08:30:10 +0800
commita422f497ceae8930405c51221aa6146899c67b8a (patch)
treef4206164d69e827326197075d3a215003245199f /launcher
parentc9c0d1f87e5c28b42d9b5c2422057d88d6083f37 (diff)
downloadibus-a422f497ceae8930405c51221aa6146899c67b8a.tar.gz
ibus-a422f497ceae8930405c51221aa6146899c67b8a.tar.xz
ibus-a422f497ceae8930405c51221aa6146899c67b8a.zip
Refine coding style.
Diffstat (limited to 'launcher')
-rw-r--r--launcher/ibus.in30
1 files changed, 9 insertions, 21 deletions
diff --git a/launcher/ibus.in b/launcher/ibus.in
index 5b4ce25..fa285d8 100644
--- a/launcher/ibus.in
+++ b/launcher/ibus.in
@@ -21,6 +21,7 @@
import os
import os.path
+import atexit
import sys
import time
import ibus
@@ -37,21 +38,21 @@ daemon_pid = 0
# os.close(1)
# os.close(2)
# try:
-# os.unlink(logname)
+# os.unlink(logname)
# except:
-# pass
+# pass
# fd = os.open(logname, os.O_CREAT | os.O_WRONLY)
# os.dup2(fd, 1)
# os.dup2(fd, 2)
bus = None
try:
- bus = ibus.Bus()
+ bus = ibus.Bus()
except:
- pass
+ pass
if bus:
- print >> sys.stderr, "Found an ibus-daemon has been started!"
- sys.exit(1)
+ print >> sys.stderr, "Found an ibus-daemon has been started!"
+ sys.exit(1)
try:
print "start ibus-daemon"
@@ -64,30 +65,17 @@ time.sleep (1)
try:
print "start ibus-x11"
- os.spawnv (os.P_NOWAIT, x11, [x11, "--kill-daemon"])
+ x11_pid = os.spawnv (os.P_NOWAIT, x11, [x11, "--kill-daemon"])
except:
print >> sys.stderr, "start ibus-x11 failed"
sys.exit (1)
try:
print "start ibus-panel"
- os.spawnv (os.P_NOWAIT, panel, [panel])
+ panel_pid = os.spawnv (os.P_NOWAIT, panel, [panel])
except:
print >> sys.stderr, "start ibus-panel failed"
sys.exit (1)
-# try:
-# print "start ibus-conf"
-# os.spawnv (os.P_NOWAIT, conf, [conf])
-# except:
-# print >> sys.stderr, "start ibus-conf failed"
-# sys.exit (1)
-
-try:
- os.kill (daemon_pid, 0)
-except:
- sys.exit (1)
-
os.waitpid (daemon_pid, 0)
-
os.wait ()