pull/201/head
Terrtia 2018-04-17 09:43:45 +02:00
parent d0261233aa
commit 19c90339e0
1 changed files with 1 additions and 16 deletions

View File

@ -474,15 +474,12 @@ class Show_paste(Frame):
i += 1 i += 1
except OSError as e: except OSError as e:
print('exceptoserror')
self.label_list[0]._text = "Error during parsing the filepath. Please, check manually" self.label_list[0]._text = "Error during parsing the filepath. Please, check manually"
self.label_list[1]._text = COMPLETE_PASTE_PATH_PER_PID[current_selected_value] self.label_list[1]._text = COMPLETE_PASTE_PATH_PER_PID[current_selected_value]
for i in range(2,self.num_label): for i in range(2,self.num_label):
self.label_list[i]._text = "" self.label_list[i]._text = ""
except Exception as e: except Exception as e:
print('except')
print(e)
self.label_list[0]._text = "Error while displaying the paste: " + COMPLETE_PASTE_PATH_PER_PID[current_selected_value] self.label_list[0]._text = "Error while displaying the paste: " + COMPLETE_PASTE_PATH_PER_PID[current_selected_value]
self.label_list[1]._text = str(e) self.label_list[1]._text = str(e)
for i in range(2,self.num_label): for i in range(2,self.num_label):
@ -500,7 +497,6 @@ MANAGE MODULES AND GET INFOS
def getPid(module): def getPid(module):
p = Popen([command_search_pid.format(module+".py")], stdin=PIPE, stdout=PIPE, bufsize=1, shell=True) p = Popen([command_search_pid.format(module+".py")], stdin=PIPE, stdout=PIPE, bufsize=1, shell=True)
for line in p.stdout: for line in p.stdout:
print(line)
splittedLine = line.split() splittedLine = line.split()
if 'python3' in splittedLine: if 'python3' in splittedLine:
return int(splittedLine[0]) return int(splittedLine[0])
@ -522,16 +518,13 @@ def cleanRedis():
try: try:
for line in proc.stdout: for line in proc.stdout:
line = line.decode('utf8') line = line.decode('utf8')
#print('-------------------------')
splittedLine = line.split() splittedLine = line.split()
if ('python3.5' in splittedLine or 'python3' in splittedLine): if ('python3.5' in splittedLine or 'python3' in splittedLine or 'python' in splittedLine):
#print(splittedLine)
moduleCommand = "./"+moduleName + ".py" moduleCommand = "./"+moduleName + ".py"
moduleCommand2 = moduleName + ".py" moduleCommand2 = moduleName + ".py"
if(moduleCommand in splittedLine or moduleCommand2 in splittedLine): if(moduleCommand in splittedLine or moduleCommand2 in splittedLine):
flag_pid_valid = True flag_pid_valid = True
#print(flag_pid_valid)
if not flag_pid_valid: if not flag_pid_valid:
#print flag_pid_valid, 'cleaning', pid, 'in', k #print flag_pid_valid, 'cleaning', pid, 'in', k
@ -541,7 +534,6 @@ def cleanRedis():
#Error due to resize, interrupted sys call #Error due to resize, interrupted sys call
except IOError as e: except IOError as e:
print('exceptp')
inst_time = datetime.datetime.fromtimestamp(int(time.time())) inst_time = datetime.datetime.fromtimestamp(int(time.time()))
log(([str(inst_time).split(' ')[1], " - ", " - ", "Cleaning fail due to resize."], 0)) log(([str(inst_time).split(' ')[1], " - ", " - ", "Cleaning fail due to resize."], 0))
@ -572,8 +564,6 @@ def kill_module(module, pid):
p = psutil.Process(int(pid)) p = psutil.Process(int(pid))
p.terminate() p.terminate()
except Exception as e: except Exception as e:
print('except')
print(e)
#print pid, 'already killed' #print pid, 'already killed'
inst_time = datetime.datetime.fromtimestamp(int(time.time())) inst_time = datetime.datetime.fromtimestamp(int(time.time()))
log(([str(inst_time).split(' ')[1], module, pid, "Already killed"], 0)) log(([str(inst_time).split(' ')[1], module, pid, "Already killed"], 0))
@ -651,7 +641,6 @@ def fetchQueueData():
try: try:
last_kill_try = time.time() - lastTimeKillCommand[moduleNum] last_kill_try = time.time() - lastTimeKillCommand[moduleNum]
except KeyError: except KeyError:
print('KeyError')
last_kill_try = kill_retry_threshold+1 last_kill_try = kill_retry_threshold+1
if args.autokill == 1 and last_kill_try > kill_retry_threshold : if args.autokill == 1 and last_kill_try > kill_retry_threshold :
kill_module(queue, int(moduleNum)) kill_module(queue, int(moduleNum))
@ -666,7 +655,6 @@ def fetchQueueData():
mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent() mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent()
except psutil.NoSuchProcess: except psutil.NoSuchProcess:
print('no such process')
del CPU_OBJECT_TABLE[int(moduleNum)] del CPU_OBJECT_TABLE[int(moduleNum)]
del CPU_TABLE[moduleNum] del CPU_TABLE[moduleNum]
cpu_percent = 0 cpu_percent = 0
@ -681,7 +669,6 @@ def fetchQueueData():
cpu_avg = cpu_percent cpu_avg = cpu_percent
mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent() mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent()
except psutil.NoSuchProcess: except psutil.NoSuchProcess:
print('no such process2')
cpu_percent = 0 cpu_percent = 0
cpu_avg = cpu_percent cpu_avg = cpu_percent
mem_percent = 0 mem_percent = 0
@ -841,7 +828,6 @@ if __name__ == "__main__":
for line in module_file: for line in module_file:
module_file_array.add(line[:-1]) module_file_array.add(line[:-1])
except IOError as e: except IOError as e:
print('IOError')
if e.errno == 2: #module_file not found, creating a new one if e.errno == 2: #module_file not found, creating a new one
print(path_allmod + " not found.\nCreating a new one.") print(path_allmod + " not found.\nCreating a new one.")
os.system("./../doc/generate_modules_data_flow_graph.sh") os.system("./../doc/generate_modules_data_flow_graph.sh")
@ -859,7 +845,6 @@ if __name__ == "__main__":
try: try:
input("Press < ENTER > to launch the manager...") input("Press < ENTER > to launch the manager...")
except SyntaxError: except SyntaxError:
print('excepterror')
pass pass
last_scene = None last_scene = None