(project_name, j, config)
return u' '.join(line)
Create and return a one-line summary of the push in `j`.
Create and return a one-line summary of the push in `j`.
Create and return a one - line summary of the push in j .
def _create_push_summary(project_name, j, config):
    """
    Create and return a one-line summary of the push in `j`.
    """
    original = j['original']
    show_branch = config.get('show_branch', True)

    # Build the push summary.
    line = []

    line.append(u'{RESET}[{BLUE}{name}{RESET}]'.format(
        name=project_name,
        **HookService.colors
    ))

    # The user doing the push, if available.
    if j['pusher']:
        line.append(u'{ORANGE}{pusher}{RESET} pushed'.format(
            pusher=j['pusher'],
            **HookService.colors
        ))

    # The number of commits included in this push.
    line.append(u'{GREEN}{count}{RESET} {commits}'.format(
        count=len(original['commits']),
        commits='commit' if len(original['commits']) == 1 else 'commits',
        **HookService.colors
    ))

    if show_branch and j['branch']:
        line.append(u'to {GREEN}{branch}{RESET}'.format(
            branch=j['branch'],
            **HookService.colors
        ))

    # File movement summary.
    line.append(u'[+{added}/-{removed}/\u00B1{modified}]'.format(
        added=len(j['files']['added']),
        removed=len(j['files']['removed']),
        modified=len(j['files']['modified'])
    ))

    # The shortened URL linking to the compare page.
    line.append(u'{PINK}{compare_link}{RESET}'.format(
        compare_link=GithubHook.shorten(original['compare']),
        **HookService.colors
    ))

    return u' '.join(line)
def _create_push_summary ( project_name , j , config ) : original = j [ 'original' ] show_branch = config . get ( 'show_branch' , True ) # Build the push summary. line = [ ] line . append ( u'{RESET}[{BLUE}{name}{RESET}]' . format ( name = project_name , * * HookService . colors ) ) # The user doing the push, if available. if j [ 'pusher' ] : line . append ( u'{ORANGE}{pusher}{RESET} pushed' . format ( pusher = j [ 'pusher' ] , * * HookService . colors ) ) # The number of commits included in this push. line . append ( u'{GREEN}{count}{RESET} {commits}' . format ( count = len ( original [ 'commits' ] ) , commits = 'commit' if len ( original [ 'commits' ] ) == 1 else 'commits' , * * HookService . colors ) ) if show_branch and j [ 'branch' ] : line . append ( u'to {GREEN}{branch}{RESET}' . format ( branch = j [ 'branch' ] , * * HookService . colors ) ) # File movement summary. line . append ( u'[+{added}/-{removed}/\u00B1{modified}]' . format ( added = len ( j [ 'files' ] [ 'added' ] ) , removed = len ( j [ 'files' ] [ 'removed' ] ) , modified = len ( j [ 'files' ] [ 'modified' ] ) ) ) # The shortened URL linking to the compare page. line . append ( u'{PINK}{compare_link}{RESET}' . format ( compare_link = GithubHook . shorten ( original [ 'compare' ] ) , * * HookService . colors ) ) return u' ' . join ( line )