Begin refactoring

master3.3
Mike Khiretskiy 10 years ago
parent da8a0d5da9
commit 8ff5da24c2

@ -275,8 +275,7 @@ class TrayIcon (QtGui.QSystemTrayIcon):
""" """
pid = str(self._parent.sys_update_pid) pid = str(self._parent.sys_update_pid)
client_obj = self._parent.localhost_ClientObj client_obj = self._parent.localhost_ClientObj
pids = map(str, client_list_pid(client_obj.client)) pids = map(str, client_pid_info(client_obj, client_obj.client, 0))
client_pid_info(client_obj, client_obj.client, 0)
if self._parent.localhost_ClientObj: if self._parent.localhost_ClientObj:
if pid and pid in client_obj.process_dict and pid in pids: if pid and pid in client_obj.process_dict and pid in pids:
return pid return pid

@ -2238,12 +2238,15 @@ class MainFrame(QtGui.QWidget):
sid = int(self.ClientObj.sid) sid = int(self.ClientObj.sid)
# call method on server # call method on server
try: try:
import time
print time.time()
if self.param_object: if self.param_object:
meth_result_temp = self.ClientObj.client.service[0] \ meth_result_temp = self.ClientObj.client.service[0] \
[self.method_name](sid, self.param_object) [self.method_name](sid, self.param_object)
else: else:
meth_result_temp = self.ClientObj.client.service[0] \ meth_result_temp = self.ClientObj.client.service[0] \
[self.method_name](sid) [self.method_name](sid)
print time.time()
except Exception, e: except Exception, e:
self.calling_error = True self.calling_error = True
msg = e.message msg = e.message

@ -63,9 +63,9 @@ def gen_pid_ls(client):
try: try:
list_pid = client_list_pid(client) list_pid = client_list_pid(client)
if not list_pid: if not list_pid:
return 0 return []
except: except:
return 0 return []
return list_pid return list_pid
def pid_inf(ClientObj, client, sid, pids): def pid_inf(ClientObj, client, sid, pids):
@ -111,6 +111,7 @@ def client_pid_info(ClientObj, client, pid):
pid_ls = gen_pid_ls(client) pid_ls = gen_pid_ls(client)
if pid_ls: if pid_ls:
pid_inf(ClientObj, client, sid, pid_ls) pid_inf(ClientObj, client, sid, pid_ls)
return pid_ls
# except: # except:
# show_msg("Error get process information") # show_msg("Error get process information")
# return 1 # return 1

Loading…
Cancel
Save