mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
Merge branch 'production' into terms-improvements
This commit is contained in:
commit
a1c47d7a13
3 changed files with 19 additions and 10 deletions
|
@ -98,4 +98,4 @@ if __name__ == "__main__":
|
||||||
publisher.info(
|
publisher.info(
|
||||||
'Categ;{};{};{};Detected {} as {};{}'.format(
|
'Categ;{};{};{};Detected {} as {};{}'.format(
|
||||||
paste.p_source, paste.p_date, paste.p_name,
|
paste.p_source, paste.p_date, paste.p_name,
|
||||||
len(found), categ), paste.p_path)
|
len(found), categ, paste.p_path))
|
||||||
|
|
|
@ -62,6 +62,7 @@ if __name__ == "__main__":
|
||||||
publisher.warning(to_print)
|
publisher.warning(to_print)
|
||||||
#Send to duplicate
|
#Send to duplicate
|
||||||
p.populate_set_out(filename, 'Duplicate')
|
p.populate_set_out(filename, 'Duplicate')
|
||||||
|
p.populate_set_out('mail;{}'.format(filename), 'BrowseWarningPaste')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
publisher.info(to_print)
|
publisher.info(to_print)
|
||||||
|
@ -69,7 +70,6 @@ if __name__ == "__main__":
|
||||||
for mail in MX_values[1]:
|
for mail in MX_values[1]:
|
||||||
print 'mail;{};{};{}'.format(1, mail, PST.p_date)
|
print 'mail;{};{};{}'.format(1, mail, PST.p_date)
|
||||||
p.populate_set_out('mail;{};{};{}'.format(1, mail, PST.p_date), 'ModuleStats')
|
p.populate_set_out('mail;{};{};{}'.format(1, mail, PST.p_date), 'ModuleStats')
|
||||||
p.populate_set_out('mail;{}'.format(filename), 'BrowseWarningPaste')
|
|
||||||
|
|
||||||
prec_filename = filename
|
prec_filename = filename
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,7 @@ class CListBox(ListBox):
|
||||||
if len(self._options) > 0 and event.key_code == Screen.KEY_UP:
|
if len(self._options) > 0 and event.key_code == Screen.KEY_UP:
|
||||||
# Move up one line in text - use value to trigger on_select.
|
# Move up one line in text - use value to trigger on_select.
|
||||||
self._line = max(0, self._line - 1)
|
self._line = max(0, self._line - 1)
|
||||||
|
self._line = min(self._line, len(self._options)-1) #If we move a line cursor from a line that has dissapear
|
||||||
self.value = self._options[self._line][1]
|
self.value = self._options[self._line][1]
|
||||||
|
|
||||||
elif len(self._options) > 0 and event.key_code == Screen.KEY_DOWN:
|
elif len(self._options) > 0 and event.key_code == Screen.KEY_DOWN:
|
||||||
|
@ -627,8 +628,7 @@ def fetchQueueData():
|
||||||
if int(card) > 0:
|
if int(card) > 0:
|
||||||
# Queue need to be killed
|
# Queue need to be killed
|
||||||
if int((datetime.datetime.now() - startTime_readable).total_seconds()) > args.treshold:
|
if int((datetime.datetime.now() - startTime_readable).total_seconds()) > args.treshold:
|
||||||
log(([str(time.time()), queue, "-", "ST:"+str(timestamp)+" PT:"+str(time.time()-float(timestamp))], 0), True)
|
log(([str(time.time()), queue, "-", "ST:"+str(timestamp)+" PT:"+str(time.time()-float(timestamp))], 0), True, show_in_board=False)
|
||||||
#log.write(json.dumps([queue, card, str(startTime_readable), str(processed_time_readable), path]) + "\n")
|
|
||||||
try:
|
try:
|
||||||
last_kill_try = time.time() - lastTimeKillCommand[moduleNum]
|
last_kill_try = time.time() - lastTimeKillCommand[moduleNum]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -718,9 +718,10 @@ def format_string(tab, padding_row):
|
||||||
printstring.append( (text, the_pid) )
|
printstring.append( (text, the_pid) )
|
||||||
return printstring
|
return printstring
|
||||||
|
|
||||||
def log(data, write_on_disk=False):
|
def log(data, write_on_disk=False, show_in_board=True):
|
||||||
printarrayLog.insert(0, data)
|
if show_in_board:
|
||||||
printarrayLog.pop()
|
printarrayLog.insert(0, data)
|
||||||
|
printarrayLog.pop()
|
||||||
if write_on_disk:
|
if write_on_disk:
|
||||||
with open(log_filename, 'a') as log:
|
with open(log_filename, 'a') as log:
|
||||||
log.write(json.dumps(data[0]) + "\n")
|
log.write(json.dumps(data[0]) + "\n")
|
||||||
|
@ -799,10 +800,18 @@ if __name__ == "__main__":
|
||||||
module_file_array = set()
|
module_file_array = set()
|
||||||
no_info_modules = {}
|
no_info_modules = {}
|
||||||
path_allmod = os.path.join(os.environ['AIL_HOME'], 'doc/all_modules.txt')
|
path_allmod = os.path.join(os.environ['AIL_HOME'], 'doc/all_modules.txt')
|
||||||
with open(path_allmod, 'r') as module_file:
|
|
||||||
for line in module_file:
|
|
||||||
module_file_array.add(line[:-1])
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(path_allmod, 'r') as module_file:
|
||||||
|
for line in module_file:
|
||||||
|
module_file_array.add(line[:-1])
|
||||||
|
except IOError as e:
|
||||||
|
if e.errno == 2: #module_file not found, creating a new one
|
||||||
|
print(path_allmod + " not found.\nCreating a new one.")
|
||||||
|
os.system("./../doc/generate_modules_data_flow_graph.sh")
|
||||||
|
with open(path_allmod, 'r') as module_file:
|
||||||
|
for line in module_file:
|
||||||
|
module_file_array.add(line[:-1])
|
||||||
cleanRedis()
|
cleanRedis()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue