def load_buildout_from_url(url):
    """Load a buildout config from an URL.
    """
    tempdir = tempfile.mkdtemp('ftw.recipe.checkversions')
    with chdir(tempdir):
        try:
            path = os.path.join(tempdir, 'temp.cfg')
            with open(path, 'w+') as cfg:
                cfg.write('[buildout]\n')
                cfg.write('extends = %s' % url)
            return Buildout(path, cloptions='', user_defaults=False)

        finally:
            shutil.rmtree(tempdir)
def load_buildout_from_file(buildout_directory, filename):
    """Load a buildout config from a local file.
    """
    with chdir(buildout_directory):
        return Buildout(filename, cloptions='', user_defaults=False)