#NEWLINE# def markdown_format( self ) : #NEWLINE# #INDENT# def format_result( result ) : #NEWLINE# #INDENT# s = ( '* %s: ' % result . py ) #NEWLINE# if result . passed : #NEWLINE# #INDENT# s += ( '%s OK (SKIP=%s) Ran %s tests' % ( ok , result . skipped , result . num_tests ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s += ( '%s Failed, log at %s' % ( fail , result . log_url ) ) #NEWLINE# #UNINDENT# if result . missing_libraries : #NEWLINE# #INDENT# s += ( ( ' (libraries not available: ' + result . missing_libraries ) + ')' ) #NEWLINE# #UNINDENT# return s #NEWLINE# #UNINDENT# pr_num = self . pr_num #NEWLINE# branch = self . pr [ 'head' ] [ 'ref' ] #NEWLINE# branch_url = ( ( self . pr [ 'head' ] [ 'repo' ] [ 'html_url' ] + '/tree/' ) + branch ) #NEWLINE# owner = self . pr [ 'head' ] [ 'repo' ] [ 'owner' ] [ 'login' ] #NEWLINE# mergeable = self . pr [ 'mergeable' ] #NEWLINE# master_sha = self . master_sha #NEWLINE# branch_sha = self . pr [ 'head' ] [ 'sha' ] [ : 7 ] #NEWLINE# ok = ':eight_spoked_asterisk:' #NEWLINE# fail = ':red_circle:' #NEWLINE# header = ( '**NetworkX: Test results for pull request #%s ' % pr_num ) #NEWLINE# header += ( "([%s '%s' branch](%s))**" % ( owner , branch , branch_url ) ) #NEWLINE# if mergeable : #NEWLINE# #INDENT# mrg = ( '%s This pull request can be merged cleanly ' % ok ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mrg = ( '%s This pull request **cannot** be merged cleanly ' % fail ) #NEWLINE# #UNINDENT# mrg += ( '(commit %s into NetworkX master %s)' % ( branch_sha , master_sha ) ) #NEWLINE# lines = ( [ header , mrg , ( 'Platform: ' + sys . platform ) , '' ] + [ format_result ( r ) for r in self . results ] ) #NEWLINE# if self . unavailable_pythons : #NEWLINE# #INDENT# lines += [ '' , ( 'Not available for testing: ' + ', ' . join ( self . unavailable_pythons ) ) ] #NEWLINE# #UNINDENT# return '\n' . join ( lines )