Added signal catching and handling in C and Cython

This commit is contained in:
Celine Mercier
2019-09-21 16:47:22 +02:00
parent 06f9d6da60
commit ec0737a600
23 changed files with 178 additions and 25 deletions

View File

@ -43,6 +43,9 @@ from obitools3.uri.decode import open_uri
from obitools3.apps.config import logger
from cpython.exc cimport PyErr_CheckSignals
__title__="Imports sequences from different formats into a DMS"
@ -189,6 +192,8 @@ def run(config):
i = 0
for entry in entries :
PyErr_CheckSignals()
if entry is None: # error or exception handled at lower level, not raised because Python generators can't resume after any exception is raised
if config['obi']['skiperror']:
i-=1
@ -200,8 +205,7 @@ def run(config):
pb(i)
elif not i%50000:
logger("info", "Imported %d entries", i)
if NUC_SEQS_view:
id_col[i] = entry.id
def_col[i] = entry.definition