aboutsummaryrefslogtreecommitdiff
path: root/cli.py
diff options
context:
space:
mode:
authorCamil Staps2015-10-04 17:07:01 +0200
committerCamil Staps2015-10-04 17:07:01 +0200
commitb08578615925cd90da0606c1e5b457ab4ee7e56e (patch)
tree4fee176a06061700f6317f85fdeea85578378508 /cli.py
parentList with alternative book names (diff)
Only insert from dump when non-empty
Diffstat (limited to 'cli.py')
-rwxr-xr-xcli.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli.py b/cli.py
index 085a0bc..921ecf5 100755
--- a/cli.py
+++ b/cli.py
@@ -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()