mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 11:24:18 +00:00
24 lines
711 B
Python
24 lines
711 B
Python
|
from app.models import Corpus, CorpusStatus
|
||
|
|
||
|
|
||
|
def init_app(app):
|
||
|
@app.cli.group('corpus')
|
||
|
def corpus():
|
||
|
''' Corpus commands. '''
|
||
|
pass
|
||
|
|
||
|
@corpus.command('dismantle')
|
||
|
def dismantle():
|
||
|
''' Dismantle built corpora. '''
|
||
|
status = [
|
||
|
CorpusStatus.QUEUED,
|
||
|
CorpusStatus.BUILDING,
|
||
|
CorpusStatus.BUILT,
|
||
|
CorpusStatus.STARTING_ANALYSIS_SESSION,
|
||
|
CorpusStatus.RUNNING_ANALYSIS_SESSION,
|
||
|
CorpusStatus.CANCELING_ANALYSIS_SESSION
|
||
|
]
|
||
|
for corpus in [x for x in Corpus.query.all() if x.status in status]:
|
||
|
corpus.status = CorpusStatus.SUBMITTED
|
||
|
corpus.num_analysis_sessions = 0
|