Moved config class into separate file.

Moved Goodreads and LDAP services into separate package.
This commit is contained in:
Daniel Pavel
2019-07-07 15:53:38 +03:00
parent 499a66dfb0
commit 006e596c72
26 changed files with 1127 additions and 1229 deletions

View File

@@ -24,19 +24,14 @@ import re
from flask_babel import gettext as _
from . import config
from .subproc_wrapper import process_open
from .subproc_wrapper import process_wait
def versionKindle():
versions = _(u'not installed')
if os.path.exists(config.config_converterpath):
try:
p = process_open(config.config_converterpath)
# p = subprocess.Popen(ub.config.config_converterpath, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
for lines in p.stdout.readlines():
if isinstance(lines, bytes):
lines = lines.decode('utf-8')
for lines in process_wait(config.config_converterpath):
if re.search('Amazon kindlegen\(', lines):
versions = lines
except Exception:
@@ -48,12 +43,7 @@ def versionCalibre():
versions = _(u'not installed')
if os.path.exists(config.config_converterpath):
try:
p = process_open([config.config_converterpath, '--version'])
# p = subprocess.Popen([ub.config.config_converterpath, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
for lines in p.stdout.readlines():
if isinstance(lines, bytes):
lines = lines.decode('utf-8')
for lines in process_wait([config.config_converterpath, '--version']):
if re.search('ebook-convert.*\(calibre', lines):
versions = lines
except Exception: