try to make get_status work

This commit is contained in:
Nikos Kouremenos 2005-11-30 16:17:06 +00:00
parent 32b3f683f4
commit 1095357c90
2 changed files with 5 additions and 5 deletions

View File

@ -208,10 +208,9 @@ class GajimRemote:
], ],
'get_status': [ 'get_status': [
_('Returns current status'), _('Returns current status (the global one unless account is specified)'),
[ [
(_('account'), _('if specified, returns status for this account; ' (_('account'), _(''), False)
'Else returns global status'), False)
] ]
], ],
@ -562,7 +561,7 @@ Type "%s help %s" for more info') % (args[argv_len][0], BASENAME, self.command))
elif self.argv_len == 5: elif self.argv_len == 5:
res = self.method(sys.argv[2], sys.argv[3], sys.argv[4]) res = self.method(sys.argv[2], sys.argv[3], sys.argv[4])
elif argv_len == 6: elif argv_len == 6:
res = self.method(sys.argv[2], sys.argv[3], sys.argv[4], res = self.method(sys.argv[2], sys.argv[3], sys.argv[4],
sys.argv[5]) sys.argv[5])
return res return res
except Exception: except Exception:

View File

@ -135,7 +135,7 @@ class SignalObject(DbusPrototype):
'''get_status(account = None) '''get_status(account = None)
returns status (show to be exact) which is the global one returns status (show to be exact) which is the global one
unless account is given''' unless account is given'''
account = self._get_real_arguments(args, 1) account = self._get_real_arguments(args, 1)[0]
accounts = gajim.contacts.keys() accounts = gajim.contacts.keys()
if not account and len(accounts) == 1: if not account and len(accounts) == 1:
# if there is only one account in roster, take it as default # if there is only one account in roster, take it as default
@ -532,6 +532,7 @@ class SignalObject(DbusPrototype):
prefs_store = method(INTERFACE)(prefs_store) prefs_store = method(INTERFACE)(prefs_store)
remove_contact = method(INTERFACE)(remove_contact) remove_contact = method(INTERFACE)(remove_contact)
add_contact = method(INTERFACE)(add_contact) add_contact = method(INTERFACE)(add_contact)
get_status = method(INTERFACE)(get_status)
class SessionBusNotPresent(Exception): class SessionBusNotPresent(Exception):
'''This exception indicates that there is no session daemon''' '''This exception indicates that there is no session daemon'''