def get_python_code(paths):
 retval = []
 for p in paths:
  if (not os.path.isdir(p)):
   raise Exception(("'%s' is not a directory." % p))
  for (dirpath, dirnames, filenames) in os.walk(p):
   for f in filenames:
    if (len([True for e in PYTHON_SOURCE_EXTENSIONS if f.endswith(e)]) > 0):
     fn = os.path.join(dirpath, f)
     with open(fn) as fd:
      content = [l.decode(PYTHON_ENCODING) for l in fd.readlines()]
     retval.append((fn, content))
 return retval

def get_python_code ( paths ) : retval = [ ] for p in paths : if ( not os . path . isdir ( p ) ) : raise Exception ( ( "'%s' is not a directory." % p ) ) for ( dirpath , dirnames , filenames ) in os . walk ( p ) : for f in filenames : if ( len ( [ True for e in PYTHON_SOURCE_EXTENSIONS if f . endswith ( e ) ] ) > 0 ) : fn = os . path . join ( dirpath , f ) with open ( fn ) as fd : content = [ l . decode ( PYTHON_ENCODING ) for l in fd . readlines ( ) ] retval . append ( ( fn , content ) ) return retval
returns all python code .