1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-29 14:27:41 +00:00

Least change to adapt with python3

change some syntax
- except clause
- unicode -> bulitins.str
- sqllite uri
- fix import local path
- 01 to 1  (0 is meaningless)

add module
- future
- builtins (from future)
- imp (python3 )
- past (from future)
- sqlalchemy (update one)

refer to
http://python-future.org/compatible_idioms.html
This commit is contained in:
林檎
2017-03-05 17:40:39 +08:00
parent 8c7ba2ccdf
commit b70191ca2a
8 changed files with 39 additions and 21 deletions

View File

@@ -37,16 +37,16 @@ def get_fb2_info(tmp_file_path, original_file_extension):
first_name = u''
return first_name + ' ' + middle_name + ' ' + last_name
author = unicode(", ".join(map(get_author, authors)))
author = str(", ".join(map(get_author, authors)))
title = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:book-title/text()', namespaces=ns)
if len(title):
title = unicode(title[0])
title = str(title[0])
else:
title = u''
description = tree.xpath('/fb:FictionBook/fb:description/fb:publish-info/fb:book-name/text()', namespaces=ns)
if len(description):
description = unicode(description[0])
description = str(description[0])
else:
description = u''