(cls, payload)
return cls._prefix_line(line, payload)
Create and return a one-line summary of the build
Create and return a one-line summary of the build
Create and return a one - line summary of the build
def _create_summary(cls, payload):
        """
        Create and return a one-line summary of the build
        """
        if payload['failed'] == True:
            status_colour = HookService.colors['RED']
        elif payload['passed'] == True:
            status_colour = HookService.colors['GREEN']

        lines = []

        # Build number
        lines.append(u'AppVeyor - build {number}:'.format(
            number=payload['buildVersion'],
        ))

        # Status and correct colours
        lines.append(u'{status}{message}{RESET}.'.format(
            status=status_colour,
            message=payload['status'],
            **HookService.colors
        ))

        # branch & commit hash
        lines.append(u'({G}{branch}{R} @ {G}{commit}{R})'.format(
            branch=payload['branch'],
            commit=payload['commitId'][:7],
            G=HookService.colors['GREEN'],
            R=HookService.colors['RESET']
        ))
        
        if payload['isPullRequest'] == True:
            lines.append(u'(pull request {G}#{n}{R})'.format(
                n=payload['pullRequestId'],
                G=HookService.colors['GREEN'],
                R=HookService.colors['RESET']
            ))
        
        line = u' '.join(lines)
        return cls._prefix_line(line, payload)
def _create_summary ( cls , payload ) : if payload [ 'failed' ] == True : status_colour = HookService . colors [ 'RED' ] elif payload [ 'passed' ] == True : status_colour = HookService . colors [ 'GREEN' ] lines = [ ] # Build number lines . append ( u'AppVeyor - build {number}:' . format ( number = payload [ 'buildVersion' ] , ) ) # Status and correct colours lines . append ( u'{status}{message}{RESET}.' . format ( status = status_colour , message = payload [ 'status' ] , * * HookService . colors ) ) # branch & commit hash lines . append ( u'({G}{branch}{R} @ {G}{commit}{R})' . format ( branch = payload [ 'branch' ] , commit = payload [ 'commitId' ] [ : 7 ] , G = HookService . colors [ 'GREEN' ] , R = HookService . colors [ 'RESET' ] ) ) if payload [ 'isPullRequest' ] == True : lines . append ( u'(pull request {G}#{n}{R})' . format ( n = payload [ 'pullRequestId' ] , G = HookService . colors [ 'GREEN' ] , R = HookService . colors [ 'RESET' ] ) ) line = u' ' . join ( lines ) return cls . _prefix_line ( line , payload )