From 706552d1dde412604e54c4f1eeef67a708fd578c Mon Sep 17 00:00:00 2001 From: rupor Date: Sun, 20 May 2018 11:14:26 -0400 Subject: [PATCH] Allowing shortened authors list in outputPattern --- fb2mobi.py | 3 ++- modules/fb2html.py | 4 +++- version.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fb2mobi.py b/fb2mobi.py index 5dc40c6..f622365 100755 --- a/fb2mobi.py +++ b/fb2mobi.py @@ -206,7 +206,8 @@ def process_file(config, infile, outfile=None): ('#abbrseries', ''.join(word[0] for word in fb2parser.book_series.split()).lower() if fb2parser.book_series else ''), ('#number', '' if not fb2parser.book_series_num else fb2parser.book_series_num.strip()), ('#padnumber', '' if not fb2parser.book_series_num else fb2parser.book_series_num.strip().zfill(fb2parser.seriespositions)), - ('#author', fb2parser.get_book_authors()), + ('#authors', fb2parser.get_book_authors()), + ('#author', fb2parser.get_book_authors(True)), ('#bookid', document_id), ]) # yapf: enable diff --git a/modules/fb2html.py b/modules/fb2html.py index 57220a2..b6447da 100755 --- a/modules/fb2html.py +++ b/modules/fb2html.py @@ -241,8 +241,10 @@ def execute(self, _, self_node, input_node, output_parent): self.book_uuid = uuid.uuid4() self.links_location = {} - def get_book_authors(self): + def get_book_authors(self, short=False): if self.book_authors: + if short and len(self.book_authors) > 1: + return self.book_authors[0] + ' и др' if self.book_lang.lower() == 'ru' else ', et al' return ', '.join(self.book_authors) else: return '' diff --git a/version.py b/version.py index 66b0977..15584a2 100755 --- a/version.py +++ b/version.py @@ -4,4 +4,4 @@ WINDOWS = sys.platform == 'win32' -VERSION = u'3.6.62' +VERSION = u'3.6.63'