When geenrating author from author sort in the edit metadata dialog, handle multiple authors

This commit is contained in:
Kovid Goyal 2011-04-26 12:52:36 -06:00
commit 2f408c170f

View File

@ -280,11 +280,16 @@ class AuthorSortEdit(EnLineEdit):
aus = self.current_val aus = self.current_val
meth = tweaks['author_sort_copy_method'] meth = tweaks['author_sort_copy_method']
if aus: if aus:
ln, _, rest = aus.partition(',') ans = []
if rest: for one in [a.strip() for a in aus.split('&')]:
if meth in ('invert', 'nocomma', 'comma'): if not one:
aus = rest.strip() + ' ' + ln.strip() continue
self.authors_edit.current_val = [aus] ln, _, rest = one.partition(',')
if rest:
if meth in ('invert', 'nocomma', 'comma'):
one = rest.strip() + ' ' + ln.strip()
ans.append(one)
self.authors_edit.current_val = ans
def auto_generate(self, *args): def auto_generate(self, *args):
au = unicode(self.authors_edit.text()) au = unicode(self.authors_edit.text())