Skip to content
This repository has been archived by the owner on Mar 15, 2020. It is now read-only.

Commit

Permalink
Allowing shortened authors list in outputPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
rupor-github committed May 20, 2018
1 parent def678c commit 706552d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion fb2mobi.py
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion modules/fb2html.py
Expand Up @@ -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 ''
Expand Down
2 changes: 1 addition & 1 deletion version.py
Expand Up @@ -4,4 +4,4 @@

WINDOWS = sys.platform == 'win32'

VERSION = u'3.6.62'
VERSION = u'3.6.63'

0 comments on commit 706552d

Please sign in to comment.