def update_authors_per_file(input_po, regexp=LANG_RE, since='weblate-credits..', pushed_by='Weblate'): authors = subprocess.check_output( [ 'git', 'shortlog', since, '--committer', pushed_by, '-sn', # Use 'sne' to include email (if that is ever needed) '--', input_po, ], stderr=subprocess.STDOUT) #TODO Clearly the above can never fail, ever. But what if it did? lang = regexp.search(input_po).groups()[0] for author_line in authors.split('\n'): if not author_line: continue author = JUST_NAME.search(author_line).groups()[0] if author in GLOBAL_AUTHORS: continue english_lang = LANGUAGENAMES.get_english(lang) language_authors[english_lang].add(author)
def update_authors_per_file(input_po, regexp=LANG_RE, since='weblate-credits..', pushed_by='Weblate'): authors = subprocess.check_output([ 'git', 'log', since, '--committer', pushed_by, '--format=%an', input_po, ], stderr=subprocess.STDOUT) #TODO Clearly the above can never fail, ever. But what if it did? lang = regexp.search(input_po).groups()[0] for author in authors.decode('utf-8').split('\n'): if not author: continue if author in GLOBAL_AUTHORS: continue english_lang = LANGUAGENAMES.get_english(lang) language_authors[english_lang].add(author)
def update_authors_per_file(input_po, regexp=LANG_RE, since='weblate-credits..', pushed_by='Weblate'): authors = subprocess.check_output([ 'git', 'shortlog', since, '--committer', pushed_by, '-sn', # Use 'sne' to include email (if that is ever needed) '--', input_po, ], stderr=subprocess.STDOUT) #TODO Clearly the above can never fail, ever. But what if it did? lang = regexp.search(input_po).groups()[0] for author_line in authors.split('\n'): if not author_line: continue author = JUST_NAME.search(author_line).groups()[0] if author in GLOBAL_AUTHORS: continue english_lang = LANGUAGENAMES.get_english(lang) language_authors[english_lang].add(author)