You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
12 years ago
|
#!/usr/bin/python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
client_types = "gui"
|
||
|
|
||
|
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 group
|
||
|
METH = 1 # Getting method line
|
||
|
|
||
|
results = client.service.get_methods(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
|
||
|
except:
|
||
|
pass
|
||
|
print _("\nYou can execute:")
|
||
|
|
||
|
return results[DAT]
|
||
|
|
||
|
def client_list_pid(client):
|
||
|
""" get all process id for this session """
|
||
|
sid = get_sid(client.SID_FILE)
|
||
|
|
||
|
try:
|
||
|
list_pid = client.service.list_pid(sid = sid)
|
||
|
if list_pid[0][0] == 0:
|
||
|
print _("Not found pid for this session!")
|
||
|
return 0
|
||
|
else:
|
||
|
for i in list_pid[0]:
|
||
|
print "pid - %d" %i
|
||
|
except:
|
||
|
print _("Server get pids error")
|
||
|
return 1
|
||
|
return len(list_pid[0])
|