parameters: (sitedir, known_paths=None)
return_statement: return known_paths
docstring: Add 'sitedir' argument to sys.path if missing and handle .pth files in
      'sitedir
docstring_summary: Add 'sitedir' argument to sys.path if missing and handle .pth files in
      'sitedir
docstring_tokens: Add sitedir argument to sys . path if missing and handle . pth files in sitedir
function: def addsitedir(sitedir, known_paths=None):
      """Add 'sitedir' argument to sys.path if missing and handle .pth files in
      'sitedir'"""
      if known_paths is None:
          known_paths = _init_pathinfo()
          reset = 1
      else:
          reset = 0
      sitedir, sitedircase = makepath(sitedir)
      if not sitedircase in known_paths:
          sys.path.append(sitedir)        # Add path component
      try:
          names = os.listdir(sitedir)
      except os.error:
          return
      dotpth = os.extsep + "pth"
      names = [name for name in names if name.endswith(dotpth)]
      for name in sorted(names):
          addpackage(sitedir, name, known_paths)
      if reset:
          known_paths = None
      return known_paths
function_tokens: def addsitedir ( sitedir , known_paths = None ) : if known_paths is None : known_paths = _init_pathinfo ( ) reset = 1 else : reset = 0 sitedir , sitedircase = makepath ( sitedir ) if not sitedircase in known_paths : sys . path . append ( sitedir ) # Add path component try : names = os . listdir ( sitedir ) except os . error : return dotpth = os . extsep + "pth" names = [ name for name in names if name . endswith ( dotpth ) ] for name in sorted ( names ) : addpackage ( sitedir , name , known_paths ) if reset : known_paths = None return known_paths