from os.path import expanduser, expandvars, isdir
sites_path = [
    "${QP_SITES}", 
    "~/qp_sites", 
    "~/.qp_sites", 
    "/www/qp_sites", 
    "/var/qp_sites"]
sites_path += __path__

__path__ = []
for raw_path in sites_path:
    path = expanduser(expandvars(raw_path))
    if isdir(path):
        __path__.append(path)
