cancel while reading in directory

This commit is contained in:
j 2014-05-26 10:34:09 +02:00
parent f2c7491d4c
commit 60a454d929

View file

@ -136,12 +136,16 @@ def run_import(options=None):
if ext in extensions:
books.append(f)
count += 1
if state.activity.get('cancel'):
state.activity = {}
return
if count % 1000 == 0:
state.activity = {
'activity': 'import',
'path': prefix,
'progress': [0, count],
}
trigger_event('activity', state.activity)
state.activity = {
'activity': 'import',
'path': prefix,