diff options
author | Camil Staps | 2015-10-04 17:07:01 +0200 |
---|---|---|
committer | Camil Staps | 2015-10-04 17:07:01 +0200 |
commit | b08578615925cd90da0606c1e5b457ab4ee7e56e (patch) | |
tree | 4fee176a06061700f6317f85fdeea85578378508 /cli.py | |
parent | List with alternative book names (diff) |
Only insert from dump when non-empty
Diffstat (limited to 'cli.py')
-rwxr-xr-x | cli.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -90,10 +90,12 @@ def load_biblehub(db, f): 'VALUES (?, ?, ?)', (v['book'], v['chapter'], v['verse'])) for translation, text in v['translations'].items(): - conn.execute('INSERT OR IGNORE INTO translated_verses ' - '(translation, book, chapter, nr, text) ' - 'VALUES (?, ?, ?, ?, ?)', - (translation, cur_book, v['chapter'], v['verse'], text)) + text = text.strip() + if text != '': + conn.execute('INSERT OR IGNORE INTO translated_verses ' + '(translation, book, chapter, nr, text) ' + 'VALUES (?, ?, ?, ?, ?)', + (translation, cur_book, v['chapter'], v['verse'], text)) click.echo(str(round(time.time() - timer, 3)) + 's') db.commit() |