def _simple_httpd_generation(directory, base_url, ports, static_directories):
    proxy_paths = [
        ('%(root)s$',                    'redirect:%(root)s/weblab/'),
        ('%(root)s/$',                   'redirect:%(root)s/weblab/'),
        ('%(root)s/weblab/client$',      'redirect:%(root)s/weblab/client/index.html'),
    ]
    for key, directory in static_directories.items():
        proxy_paths.append((key, 'file:{0}'.format(directory)))

    proxy_path = "proxy-sessions:weblabsessionid:"
    for pos, port in enumerate(ports):
        d = { 'port' : port, 'route' : 'route%s' % (pos+1), 'root' : '%(root)s' }
        proxy_path += '%(route)s=http://localhost:%(port)s/weblab/,' % d
    proxy_paths.append(('%(root)s/weblab/', proxy_path))

    proxy_paths.append(('%(root)s/weblab',              'redirect:%(root)s/weblab/'))
    proxy_paths.append(('',                            'redirect:%(root)s/weblab/'))

    if base_url in ('','/'):
        root    = ''
    else:
        root    = base_url

    apache_img_dir = '/client/images'

    server_conf_dict = { 'root' : root, 
                'directory' : os.path.abspath(directory).replace('\\','/')
            }

    proxy_paths = eval(repr(proxy_paths) % server_conf_dict)
    proxy_paths_str = "PATHS = [ \n"
    for proxy_path in proxy_paths:
        proxy_paths_str += "    %s,\n" % repr(proxy_path)
    proxy_paths_str += "]\n"

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