new command: clean_dms to clean and unlock a DMS after a bad exit.

This commit is contained in:
Celine Mercier
2019-09-20 20:38:25 +02:00
parent 783a1343c4
commit ec874c095b

View File

@ -0,0 +1,27 @@
#cython: language_level=3
from obitools3.apps.optiongroups import addMinimalInputOption
from obitools3.uri.decode import open_uri
from obitools3.dms import DMS
from obitools3.dms.capi.obidms cimport obi_clean_dms
from obitools3.apps.config import logger
from obitools3.utils cimport tobytes
__title__="Clean a DMS from unfinished views and columns"
def addOptions(parser):
addMinimalInputOption(parser)
def run(config):
DMS.obi_atexit()
logger("info", "obi clean_dms")
if obi_clean_dms(tobytes(config['obi']['inputURI'])) < 0 :
raise Exception("Error cleaning DMS", config['obi']['inputURI'])
logger("info", "Done.")