Esempio n. 1
0
def centerText(target, working_file_name, extra=False):
    text = []
    line_colors = []
    text.append(git_info.getBaseRepoName(target))
    line_colors.append(info_color)
    text.append(git_info.getLastCommitDate(target))
    line_colors.append(info_color)
    if SHOW_COMMIT_INFO:
        lines = git_info.getLastCommit(target).split('\n')
        for line in lines:
            while len(line) > 0:
                text.append(line[:MAX_MSG_LENGTH])
                line = line[MAX_MSG_LENGTH:]
                line_colors.append(info_color)
    if extra:
        text.append("File count: " + git_info.getFileCount(target))
        line_colors.append(info_color)
        for author in sorted(authors):
            text.append(author + ' ' + str(author_lines[author]))
            author_color = authors[author] % len(colors)
            line_colors.append(colors[author_color])

    overlaid = image_tools.overlayLines(
        working_file_name, text, line_colors,
        OVERRIDE_FONT, OVERRIDE_X, OVERRIDE_Y, 2)
    return overlaid
Esempio n. 2
0
def cornerText(target, working_file_name):
    text = []
    line_colors = []
    line_colors.append(greenish)
    text.append(git_info.getBaseRepoName(target))
    for author in sorted( authors):
        text.append(author + ' ' + str(author_lines[author]))
        author_color = authors[author] % len(colors)
        line_colors.append(colors[author_color])
    x = 100
    y = ROW_OFFSET
    overlaid = image_tools.overlayLines(working_file_name, text, line_colors, 40, x, y)
    return overlaid
Esempio n. 3
0
def centerText(target, working_file_name, extra = False):
    text = []
    line_colors = []
    text.append(git_info.getBaseRepoName(target))
    line_colors.append(white)
    text.append(git_info.getLastCommitDate(target))
    line_colors.append(white)
    if extra:
        text.append("File count: " + git_info.getFileCount(target))
        line_colors.append(white)
        for author in sorted( authors):
            text.append(author + ' ' + str(author_lines[author]))
            author_color = authors[author] % len(colors)
            line_colors.append(colors[author_color])        
    overlaid = image_tools.overlayLines(working_file_name, text, line_colors, OVERRIDE_FONT, OVERRIDE_X, OVERRIDE_Y,2)        
    return overlaid