parameters: (dir, maxlevels=10, ddir=None,
                  force=0, rx=None, quiet=0)
return_statement: return success
docstring: Byte-compile all modules in the given directory tree.
  
      Arguments (only dir is required):
  
      dir:       the directory to byte-compile
      maxlevels: maximum recursion level (default 10)
      ddir:      the directory that will be prepended to the path to the
                 file as it is compiled into each byte-code file.
      force:     if 1, force compilation, even if timestamps are up-to-date
      quiet:     if 1, be quiet during compilation
docstring_summary: Byte-compile all modules in the given directory tree.
docstring_tokens: Byte - compile all modules in the given directory tree .
function: def compile_dir(dir, maxlevels=10, ddir=None,
                  force=0, rx=None, quiet=0):
      """Byte-compile all modules in the given directory tree.
  
      Arguments (only dir is required):
  
      dir:       the directory to byte-compile
      maxlevels: maximum recursion level (default 10)
      ddir:      the directory that will be prepended to the path to the
                 file as it is compiled into each byte-code file.
      force:     if 1, force compilation, even if timestamps are up-to-date
      quiet:     if 1, be quiet during compilation
      """
      if not quiet:
          print 'Listing', dir, '...'
      try:
          names = os.listdir(dir)
      except os.error:
          print "Can't list", dir
          names = []
      names.sort()
      success = 1
      for name in names:
          fullname = os.path.join(dir, name)
          if sys.platform == "win32" and sys.version.find("GCC") >= 0:
              fullname = fullname.replace('\\','/')
          if ddir is not None:
              dfile = os.path.join(ddir, name)
          else:
              dfile = None
          if not os.path.isdir(fullname):
              if not compile_file(fullname, ddir, force, rx, quiet):
                  success = 0
          elif maxlevels > 0 and \
               name != os.curdir and name != os.pardir and \
               os.path.isdir(fullname) and \
               not os.path.islink(fullname):
              if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
                                 quiet):
                  success = 0
      return success
function_tokens: def compile_dir ( dir , maxlevels = 10 , ddir = None , force = 0 , rx = None , quiet = 0 ) : if not quiet : print 'Listing' , dir , '...' try : names = os . listdir ( dir ) except os . error : print "Can't list" , dir names = [ ] names . sort ( ) success = 1 for name in names : fullname = os . path . join ( dir , name ) if sys . platform == "win32" and sys . version . find ( "GCC" ) >= 0 : fullname = fullname . replace ( '\\' , '/' ) if ddir is not None : dfile = os . path . join ( ddir , name ) else : dfile = None if not os . path . isdir ( fullname ) : if not compile_file ( fullname , ddir , force , rx , quiet ) : success = 0 elif maxlevels > 0 and name != os . curdir and name != os . pardir and os . path . isdir ( fullname ) and not os . path . islink ( fullname ) : if not compile_dir ( fullname , maxlevels - 1 , dfile , force , rx , quiet ) : success = 0 return success