<s> import glob <EOL> import os <EOL> import subprocess <EOL> LIB_DIR = "<STR_LIT>" <EOL> EXE_PATH = "<STR_LIT>" <EOL> modules = [ ] <EOL> for fn in glob . glob ( "<STR_LIT>" % LIB_DIR ) : <EOL> modules . append ( os . path . basename ( fn ) [ : - <NUM_LIT:3> ] ) <EOL> for fn in glob . glob ( "<STR_LIT>" % LIB_DIR ) : <EOL> if not os . path . isdir ( fn ) : <EOL> continue <EOL> modules . append ( os . path . basename ( fn ) ) <EOL> print modules <EOL> nworked = <NUM_LIT:0> <EOL> total = <NUM_LIT:0> <EOL> print len ( modules ) <EOL> f = open ( "<STR_LIT>" , '<STR_LIT:w>' ) <EOL> for m in modules : <EOL> if '<STR_LIT:->' in m : <EOL> continue <EOL> p = subprocess . Popen ( [ EXE_PATH , "<STR_LIT>" ] , stdin = subprocess . PIPE , stderr = subprocess . PIPE ) <EOL> p . stdin . write ( "<STR_LIT>" ) <EOL> p . stdin . write ( "<STR_LIT>" % m ) <EOL> p . stdin . write ( "<STR_LIT>" ) <EOL> p . stdin . close ( ) <EOL> err = p . stderr . read ( ) <EOL> code = p . wait ( ) <EOL> if code == <NUM_LIT:0> : <EOL> print m , "<STR_LIT>" , <EOL> nworked += <NUM_LIT:1> <EOL> else : <EOL> print code <EOL> print m , "<STR_LIT>" , <EOL> print >> f , m <EOL> print >> f , '<STR_LIT:\n>' . join ( err . split ( '<STR_LIT:\n>' ) [ - <NUM_LIT:4> : ] ) <EOL> f . flush ( ) <EOL> total += <NUM_LIT:1> <EOL> print "<STR_LIT>" % ( nworked , total ) </s>
