(cls, j, config)
return u' '.join(line)
Create and return a one-line summary of things not involving commits
        in `j`.
Create and return a one-line summary of things not involving commits
        in `j`.
Create and return a one - line summary of things not involving commits in j .
def _create_non_commit_summary(cls, j, config):
        """
        Create and return a one-line summary of things not involving commits
        in `j`.
        """
        original = j['original']
        full_project_name = config.get('full_project_name', False)

        line = []

        # The name of the repository.
        project_name = original['repository']['name']
        if full_project_name:
            # The use wants the <username>/<project name> form from
            # github, not the Notifico name.
            project_name = '{username}/{project_Name}'.format(
                username=original['repository']['owner']['name'],
                project_Name=project_name
            )

        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}'.format(
                pusher=j['pusher'],
                **HookService.colors
            ))

        if j['tag']:
            if not original.get('head_commit'):
                if not is_event_allowed(config, 'delete', 'tag'):
                    return ''
                line.append(u'deleted' if j['pusher'] else u'Deleted')
                line.append(u'tag')
            else:
                if not is_event_allowed(config, 'create', 'tag'):
                    return ''
                # Verb with proper capitalization
                line.append(u'tagged' if j['pusher'] else u'Tagged')

                # The sha1 hash of the head (tagged) commit.
                line.append(u'{GREEN}{sha}{RESET} as'.format(
                    sha=original['head_commit']['id'][:7],
                    **HookService.colors
                ))

            # The tag itself.
            line.append(u'{GREEN}{tag}{RESET}'.format(
                tag=j['tag'],
                **HookService.colors
            ))
        elif j['branch']:
            # Verb with proper capitalization
            if original['deleted']:
                if not is_event_allowed(config, 'delete', 'branch'):
                    return ''
                line.append(
                    u'deleted branch' if j['pusher'] else u'Deleted branch'
                )
            else:
                if not is_event_allowed(config, 'create', 'branch'):
                    return ''
                line.append(
                    u'created branch' if j['pusher'] else u'Created branch'
                )

            # The branch name
            line.append(u'{GREEN}{branch}{RESET}'.format(
                branch=j['branch'],
                **HookService.colors
            ))

        if original['head_commit']:
            # The shortened URL linking to the head commit.
            line.append(u'{PINK}{link}{RESET}'.format(
                link=GithubHook.shorten(original['head_commit']['url']),
                **HookService.colors
            ))

        return u' '.join(line)
def _create_non_commit_summary ( cls , j , config ) : original = j [ 'original' ] full_project_name = config . get ( 'full_project_name' , False ) line = [ ] # The name of the repository. project_name = original [ 'repository' ] [ 'name' ] if full_project_name : # The use wants the <username>/<project name> form from # github, not the Notifico name. project_name = '{username}/{project_Name}' . format ( username = original [ 'repository' ] [ 'owner' ] [ 'name' ] , project_Name = project_name ) 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}' . format ( pusher = j [ 'pusher' ] , * * HookService . colors ) ) if j [ 'tag' ] : if not original . get ( 'head_commit' ) : if not is_event_allowed ( config , 'delete' , 'tag' ) : return '' line . append ( u'deleted' if j [ 'pusher' ] else u'Deleted' ) line . append ( u'tag' ) else : if not is_event_allowed ( config , 'create' , 'tag' ) : return '' # Verb with proper capitalization line . append ( u'tagged' if j [ 'pusher' ] else u'Tagged' ) # The sha1 hash of the head (tagged) commit. line . append ( u'{GREEN}{sha}{RESET} as' . format ( sha = original [ 'head_commit' ] [ 'id' ] [ : 7 ] , * * HookService . colors ) ) # The tag itself. line . append ( u'{GREEN}{tag}{RESET}' . format ( tag = j [ 'tag' ] , * * HookService . colors ) ) elif j [ 'branch' ] : # Verb with proper capitalization if original [ 'deleted' ] : if not is_event_allowed ( config , 'delete' , 'branch' ) : return '' line . append ( u'deleted branch' if j [ 'pusher' ] else u'Deleted branch' ) else : if not is_event_allowed ( config , 'create' , 'branch' ) : return '' line . append ( u'created branch' if j [ 'pusher' ] else u'Created branch' ) # The branch name line . append ( u'{GREEN}{branch}{RESET}' . format ( branch = j [ 'branch' ] , * * HookService . colors ) ) if original [ 'head_commit' ] : # The shortened URL linking to the head commit. line . append ( u'{PINK}{link}{RESET}' . format ( link = GithubHook . shorten ( original [ 'head_commit' ] [ 'url' ] ) , * * HookService . colors ) ) return u' ' . join ( line )