def add_env(self, envname): sp_dir = get_site_packages_dir(envname) if not sp_dir: raise Exception("Could not find virtualenv named {}".format(envname)) if envname in self.envs: del self.envs[envname] local_sp = os.path.split(self.filepath)[0] rel = os.path.relpath(sp_dir, local_sp) self.envs[envname] = Env(envname, rel)
def add_env(self, envname): sp_dir = get_site_packages_dir(envname) if not sp_dir: raise Exception( "Could not find virtualenv named {}".format(envname)) if envname in self.envs: del self.envs[envname] local_sp = os.path.split(self.filepath)[0] rel = os.path.relpath(sp_dir, local_sp) self.envs[envname] = Env(envname, rel)
def get_pathfile_path(pathfile_name="_envplus.pth"): sp_dir = helpers.get_site_packages_dir(os.environ["VIRTUAL_ENV"]) pathfile_path = os.path.join(sp_dir, pathfile_name) return pathfile_path