<s> from debile . slave . wrappers . findbugs import parse_findbugs <EOL> from debile . slave . utils import cd <EOL> from debile . utils . commands import run_command <EOL> import os <EOL> def findbugs ( deb , analysis ) : <EOL> _ , err , ret = run_command ( [ "<STR_LIT>" , "<STR_LIT>" , deb , "<STR_LIT>" ] ) <EOL> if ret != <NUM_LIT:0> : <EOL> raise Exception ( "<STR_LIT>" + err ) <EOL> with cd ( '<STR_LIT>' ) : <EOL> os . putenv ( "<STR_LIT>" , "<STR_LIT:C>" ) <EOL> out , err , _ = run_command ( [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:.>' <EOL> ] ) <EOL> xmlbytes = out . encode ( "<STR_LIT:utf-8>" ) <EOL> failed = False <EOL> for issue in parse_findbugs ( xmlbytes ) : <EOL> analysis . results . append ( issue ) <EOL> if not failed and issue . severity in [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:error>' , '<STR_LIT>' <EOL> ] : <EOL> failed = True <EOL> return ( analysis , err , failed , None , None ) <EOL> def version ( ) : <EOL> out , _ , ret = run_command ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> if ret != <NUM_LIT:0> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> version = out . strip ( ) <EOL> return ( '<STR_LIT>' , version . strip ( ) ) </s>
