new command: clean_dms to clean and unlock a DMS after a bad exit.
This commit is contained in:
27
python/obitools3/commands/clean_dms.pyx
Executable file
27
python/obitools3/commands/clean_dms.pyx
Executable 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.")
|
Reference in New Issue
Block a user