mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-24 17:10:31 +00:00
Update testresults on windows
Added encoding on fb2 upload
This commit is contained in:
parent
a0449b50c8
commit
c85cfa90a4
@ -985,10 +985,13 @@ def _config_string(to_save, x):
|
|||||||
|
|
||||||
|
|
||||||
def _configuration_gdrive_helper(to_save):
|
def _configuration_gdrive_helper(to_save):
|
||||||
|
gdrive_error = None
|
||||||
|
gdrive_secrets = {}
|
||||||
|
|
||||||
if not os.path.isfile(gdriveutils.SETTINGS_YAML):
|
if not os.path.isfile(gdriveutils.SETTINGS_YAML):
|
||||||
config.config_use_google_drive = False
|
config.config_use_google_drive = False
|
||||||
|
|
||||||
gdrive_secrets = {}
|
if gdrive_support:
|
||||||
gdrive_error = gdriveutils.get_error_text(gdrive_secrets)
|
gdrive_error = gdriveutils.get_error_text(gdrive_secrets)
|
||||||
if "config_use_google_drive" in to_save and not config.config_use_google_drive and not gdrive_error:
|
if "config_use_google_drive" in to_save and not config.config_use_google_drive and not gdrive_error:
|
||||||
with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
|
with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
|
||||||
@ -1254,7 +1257,7 @@ def _configuration_result(error_flash=None, gdrive_error=None, configured=True):
|
|||||||
gdrivefolders = []
|
gdrivefolders = []
|
||||||
if gdrive_error is None:
|
if gdrive_error is None:
|
||||||
gdrive_error = gdriveutils.get_error_text()
|
gdrive_error = gdriveutils.get_error_text()
|
||||||
if gdrive_error:
|
if gdrive_error and gdrive_support:
|
||||||
log.error(gdrive_error)
|
log.error(gdrive_error)
|
||||||
gdrive_error = _(gdrive_error)
|
gdrive_error = _(gdrive_error)
|
||||||
else:
|
else:
|
||||||
|
@ -29,7 +29,7 @@ def get_fb2_info(tmp_file_path, original_file_extension):
|
|||||||
'l': 'http://www.w3.org/1999/xlink',
|
'l': 'http://www.w3.org/1999/xlink',
|
||||||
}
|
}
|
||||||
|
|
||||||
fb2_file = open(tmp_file_path)
|
fb2_file = open(tmp_file_path, encoding="utf-8")
|
||||||
tree = etree.fromstring(fb2_file.read().encode())
|
tree = etree.fromstring(fb2_file.read().encode())
|
||||||
|
|
||||||
authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns)
|
authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user