private boolean gatherEvidence ( Dependency dependency , EvidenceType type , Pattern pattern , String contents , String source , String name , Confidence confidence ) { final Matcher matcher = pattern . matcher ( contents ) ; final boolean found = matcher . find ( ) ; if ( found ) { dependency . addEvidence ( type , source , name , matcher . group ( 4 ) , confidence ) ; if ( type == EvidenceType . VERSION ) { //TODO - this seems broken as we are cycling over py files and could be grabbing versions from multiple? dependency . setVersion ( matcher . group ( 4 ) ) ; final String dispName = String . format ( "%s:%s" , dependency . getName ( ) , dependency . getVersion ( ) ) ; dependency . setDisplayFileName ( dispName ) ; } } return found ; }
Gather evidence from a Python source file using the given string assignment regex pattern .