'Add \'sitedir\' argument to sys.path if missing.'

def AddSiteDir(self, sitedir):

    known_paths = self.InitPathinfo()
    (sitedir, sitedircase) = self.MakePath(sitedir)
    if ((sitedircase not in known_paths) and os.path.exists(sitedir)):
        sys.path.append(sitedir)
    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):
        self.AddPackage(sitedir, name, known_paths)
