catch remote method exceptions
This commit is contained in:
parent
2b460a39fe
commit
dcedc99d23
|
@ -213,20 +213,20 @@ def gtk_quit():
|
||||||
# method(sys.argv[2:]) doesn't work, cos sys.argv[2:] is a tuple
|
# method(sys.argv[2:]) doesn't work, cos sys.argv[2:] is a tuple
|
||||||
def call_remote_method(method):
|
def call_remote_method(method):
|
||||||
argv_len = len(sys.argv)
|
argv_len = len(sys.argv)
|
||||||
#~ try:
|
try:
|
||||||
if argv_len == 2:
|
if argv_len == 2:
|
||||||
res = method()
|
res = method()
|
||||||
elif argv_len == 3:
|
elif argv_len == 3:
|
||||||
res = method(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:
|
||||||
res = method(sys.argv[2], sys.argv[3], sys.argv[4])
|
res = method(sys.argv[2], sys.argv[3], sys.argv[4])
|
||||||
elif argv_len == 6:
|
elif argv_len == 6:
|
||||||
res = method(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5])
|
res = method(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5])
|
||||||
return res
|
return res
|
||||||
#~ except:
|
except:
|
||||||
#~ send_error(_('Service not available'))
|
send_error(_('Service not available'))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue