def prefix_if_in_private_env(spec): private_envs_json = get_private_envs_json() if not private_envs_json: return None prefixes = tuple(prefix for pkg, prefix in iteritems(private_envs_json) if pkg.startswith(spec)) prefix = prefixes[0] if len(prefixes) > 0 else None return prefix
def pkg_if_in_private_env(spec): private_envs_json = get_private_envs_json() pkgs = tuple(pkg for pkg, prefix in iteritems(private_envs_json) if pkg.startswith(spec)) pkg = pkgs[0] if len(pkgs) > 0 else None return pkg