|
|
|
@ -93,32 +93,22 @@ def client_pid_info(client):
|
|
|
|
|
|
|
|
|
|
def client_list_methods(client):
|
|
|
|
|
""" get & show all available methods for this certificate """
|
|
|
|
|
DAT = 0 # Access to data soap structure
|
|
|
|
|
RES = 0 # Access to result
|
|
|
|
|
COM = 0 # Getting command line
|
|
|
|
|
METH = 1 # Getting method line
|
|
|
|
|
TR_METH = 3 # Translate method name
|
|
|
|
|
results = client.service.get_methods(client.sid, client_types)
|
|
|
|
|
if not results:
|
|
|
|
|
print _('No methods available')
|
|
|
|
|
return 1
|
|
|
|
|
try:
|
|
|
|
|
if results[DAT][RES][RES][COM] == '0':
|
|
|
|
|
print _('No methods available')
|
|
|
|
|
return 1
|
|
|
|
|
results[0][0].name
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
print _('No methods available')
|
|
|
|
|
return 1
|
|
|
|
|
print _("You can execute:"), _('use option'), '--method'
|
|
|
|
|
group_dict = {}
|
|
|
|
|
for group in results.stringArray:
|
|
|
|
|
if len (group.string) == 4:
|
|
|
|
|
group_dict[group.string[METH]] = group.string[TR_METH]
|
|
|
|
|
if len (group.string) == 3:
|
|
|
|
|
group_dict[group.string[METH]] = group.string[TR_METH-1]
|
|
|
|
|
sort_keys = group_dict.keys()
|
|
|
|
|
sort_keys.sort()
|
|
|
|
|
for key in sort_keys:
|
|
|
|
|
print " %s - %s" % (key, group_dict[key])
|
|
|
|
|
for method in sorted(results[0],key=lambda x:x.name):
|
|
|
|
|
if method.title:
|
|
|
|
|
print " {name} - {title}".format(name=method.name,
|
|
|
|
|
title=method.title)
|
|
|
|
|
else:
|
|
|
|
|
print " {name}".format(name=name)
|
|
|
|
|
|
|
|
|
|
def client_pid_kill(client, pid):
|
|
|
|
|
sid = get_sid(client.SID_FILE)
|
|
|
|
|