<s> from debile . slave . wrappers . pylint import parse_pylint <EOL> from debile . slave . utils import cd <EOL> from debile . utils . commands import run_command <EOL> import os <EOL> import fnmatch <EOL> def find_python_files ( directory ) : <EOL> for root , dirs , files in os . walk ( directory ) : <EOL> for basename in files : <EOL> if fnmatch . fnmatch ( basename , '<STR_LIT>' ) : <EOL> filename = os . path . join ( root , basename ) <EOL> yield filename <EOL> def pylint ( dsc , analysis ) : <EOL> run_command ( [ "<STR_LIT>" , "<STR_LIT>" , dsc , "<STR_LIT>" ] ) <EOL> with cd ( '<STR_LIT>' ) : <EOL> sources = find_python_files ( '<STR_LIT:.>' ) <EOL> failed = False <EOL> output = "<STR_LIT>" <EOL> for source in sources : <EOL> out , _ , ret = run_command ( [ <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> source <EOL> ] ) <EOL> failed = ret != <NUM_LIT:0> <EOL> if out is not None : <EOL> output += out <EOL> for issue in parse_pylint ( out . splitlines ( ) ) : <EOL> analysis . results . append ( issue ) <EOL> return ( analysis , output , 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> name , version = out . splitlines ( ) [ <NUM_LIT:0> ] . strip ( "<STR_LIT:U+0020>" ) . split ( "<STR_LIT:U+0020>" ) <EOL> return ( name , version . strip ( '<STR_LIT:U+002C>' ) ) </s>
