Skip to content
Snippets Groups Projects
Commit 39b2c854 authored by nicfit's avatar nicfit
Browse files

Since gajim-remote is a user script and the output of which is often parsed I think

it unwise to include the "inconsistent use of tabs and spaces in indentation" warning.
Filtering stderr works, but may also filter out useful info.
parent a39d946b
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ except:
def send_error(error_message):
'''Writes error message to stderr and exits'''
print >> sys.stderr, error_message.encode(PREFERRED_ENCODING)
sys.exit()
sys.exit(1)
try:
import dbus
......@@ -226,7 +226,7 @@ class GajimRemote:
print self.help_on_command(sys.argv[2]).encode(PREFERRED_ENCODING)
else:
print self.compose_help().encode(PREFERRED_ENCODING)
sys.exit()
sys.exit(0)
self.init_connection()
self.check_arguments()
......@@ -235,8 +235,13 @@ class GajimRemote:
if self.argv_len < 3:
send_error(_('Missing argument "contact_jid"'))
res = self.call_remote_method()
self.print_result(res)
try:
res = self.call_remote_method()
except exceptions.ServiceNotAvailable:
# At this point an error message has already been displayed
sys.exit(1)
else:
self.print_result(res)
def print_result(self, res):
''' Print retrieved result to the output '''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment