Skip to content

Commit

Permalink
use absolute redis path on macOS, rm useless try except
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Jan 2, 2021
1 parent c433707 commit 11b6adf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class WordDumbDumb(InterfaceActionBase):
description = 'Create Kindle Word Wise file.'
supported_platforms = ['linux', 'osx', 'windows']
author = 'xxyzz'
version = (2, 0, 1)
version = (2, 0, 2)
minimum_calibre_version = (5, 0, 0) # Python3
actual_plugin = 'calibre_plugins.worddumb.ui:WordDumb'

Expand Down
13 changes: 6 additions & 7 deletions database.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ def insert_lemma(data, ll_conn):

def start_redis_server(db_path):
import subprocess
subprocess.Popen(['redis-server', '--dir', db_path])
import platform
if platform.system() == 'Darwin':
subprocess.Popen(['/usr/local/bin/redis-server', '--dir', db_path])
else:
subprocess.Popen(['redis-server', '--dir', db_path])

import redis
while True:
try:
r = redis.Redis()
return r
except ConnectionRefusedError:
pass
return redis.Redis()

0 comments on commit 11b6adf

Please sign in to comment.