logic fix

This commit is contained in:
Nikos Kouremenos 2005-07-17 22:00:40 +00:00
parent 139bb5ac0c
commit f9e76174ac
1 changed files with 7 additions and 6 deletions

View File

@ -20,15 +20,14 @@
## GNU General Public License for more details. ## GNU General Public License for more details.
## ##
# gajim-remote help will show you the 'dbus' api # gajim-remote help will show you the DBUS API of Gajim
# That api is also usable, and the code to use it follows..
import sys import sys
import gtk import gtk
import gobject import gobject
def send_error(error_message): def send_error(error_message):
sys.stderr.write(error_message+'\n') sys.stderr.write(error_message + '\n')
sys.stderr.flush() sys.stderr.flush()
sys.exit(1) sys.exit(1)
@ -118,8 +117,6 @@ if command == 'contact_info':
INTERFACE, SERVICE, OBJ_PATH) INTERFACE, SERVICE, OBJ_PATH)
except: except:
send_error('Service not available') send_error('Service not available')
gobject.timeout_add(5000, gtk_quit)
gtk.main()
#FIXME: gajim-remote.py change_status help to inform what it does with optional arg (account). the same for rest of methods that accept args #FIXME: gajim-remote.py change_status help to inform what it does with optional arg (account). the same for rest of methods that accept args
@ -129,7 +126,7 @@ try:
if argv_len == 2: if argv_len == 2:
res = method() res = method()
elif argv_len == 3: elif argv_len == 3:
res = method(str(sys.argv[2])) res = method(sys.argv[2])
elif argv_len == 4: elif argv_len == 4:
res = method(sys.argv[2], sys.argv[3]) res = method(sys.argv[2], sys.argv[3])
elif argv_len == 5: elif argv_len == 5:
@ -138,3 +135,7 @@ try:
print res print res
except: except:
send_error('Service not available') send_error('Service not available')
if command == 'contact_info':
gobject.timeout_add(5000, gtk_quit) # wait 5 sec maximum
gtk.main()