def printFlakeOutput(text):
 ret = 0
 gotError = False
 for line in text.split('\n'):
  m = re.match('[^\\:]+\\:\\d+\\:\\d+\\: (\\w+) .*', line)
  if (m is None):
   print line
  else:
   gotError = True
   error = m.group(1)
   if (error in FLAKE_MANDATORY):
    print (('\x1b[0;31m' + line) + '\x1b[0m')
    ret |= 2
   elif (error in FLAKE_RECOMMENDED):
    print (('\x1b[0;33m' + line) + '\x1b[0m')
   elif (error in FLAKE_OPTIONAL):
    print (('\x1b[0;32m' + line) + '\x1b[0m')
   elif (error in FLAKE_IGNORE):
    continue
   else:
    print (('\x1b[0;36m' + line) + '\x1b[0m')
 if (not gotError):
  print '    [ no errors ]\n'
 return ret

def printFlakeOutput ( text ) : ret = 0 gotError = False for line in text . split ( '\n' ) : m = re . match ( '[^\\:]+\\:\\d+\\:\\d+\\: (\\w+) .*' , line ) if ( m is None ) : print line else : gotError = True error = m . group ( 1 ) if ( error in FLAKE_MANDATORY ) : print ( ( '\x1b[0;31m' + line ) + '\x1b[0m' ) ret |= 2 elif ( error in FLAKE_RECOMMENDED ) : print ( ( '\x1b[0;33m' + line ) + '\x1b[0m' ) elif ( error in FLAKE_OPTIONAL ) : print ( ( '\x1b[0;32m' + line ) + '\x1b[0m' ) elif ( error in FLAKE_IGNORE ) : continue else : print ( ( '\x1b[0;36m' + line ) + '\x1b[0m' ) if ( not gotError ) : print '    [ no errors ]\n' return ret
print flake output .