def httpd_config_generate(directory):
    debugging_variables = {}
    execfile(os.path.join(directory, 'debugging.py'), debugging_variables)
    ports = debugging_variables.get('PORTS', {}).get('json')
    base_url = debugging_variables.get('BASE_URL', '')
    if base_url in ('','/'):
        base_url = ''

    static_directories = OrderedDict() #{
        # url path : disk path
    # }
    static_directories[base_url + '/weblab/client'] =                            data_filename('weblab/core/static/oldclient').replace('\\','/') # \ => / for Windows
    flask_admin_static = os.path.join(os.path.dirname(flask_admin.__file__), 'static')
    static_directories[base_url + '/weblab/admin/static'] =                      flask_admin_static.replace('\\','/')
    # TODO: Avoid repeated paths
    static_directories[base_url + '/weblab/instructor/static'] =                 data_filename('weblab/admin/web/static').replace('\\','/')
    static_directories[base_url + '/weblab/profile/static'] =                    data_filename('weblab/admin/web/static').replace('\\','/')
    static_directories[base_url + '/weblab/web/static'] =                        data_filename('weblab/core/static').replace('\\','/')
    static_directories[base_url + '/weblab/static'] =                            data_filename('weblab/core/static').replace('\\','/')
    static_directories[base_url + '/weblab/gwt/weblabclientlab'] =               data_filename('war/weblabclientlab').replace('\\','/')
    static_directories[base_url + '/weblab/web/pub'] =                           os.path.abspath(os.path.join(directory, 'pub')).replace('\\','/')

    files = {}
    apache_contents = _apache_generation(directory, base_url, ports, static_directories)
    files['apache'] = _set_contents(directory, 'httpd/apache_weblab_generic.conf', apache_contents)
    simple_httpd_contents = _simple_httpd_generation(directory, base_url, ports, static_directories)
    files['simple'] = _set_contents(directory, 'httpd/simple_server_config.py', simple_httpd_contents)
    
    # TODO: support nginx

    return files
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/admin/script/httpd_config_generate.py/httpd_config_generate/original