def authors(self, format_arg=None): result = git.shortlog("-s", "-n", _tty_in=True, _tty_out=False) if format_arg is None: return result elif format_arg == "dict": list = result.replace("\n", "\t").split("\t")[:-1] it = iter(list[::-1]) authors = dict(zip(it, it)) for name in authors: authors[name] = int(authors[name]) return authors
def authors(self, format_arg=None): ''' returns the authors of the authors either as a text or as a dict. The format is specified as an argument. :param format_arg: if "dict" is specified a dict will be returned ''' result = git.shortlog("-s", "-n", _tty_in=True, _tty_out=False) if format_arg is None: return result elif format_arg == "dict": list = result.replace("\n", "\t").split("\t")[:-1] it = iter(list[::-1]) authors = dict(zip(it, it)) for name in authors: authors[name] = int(authors[name]) return authors