<s> import sys <EOL> import os <EOL> import pwd <EOL> import grp <EOL> import subprocess <EOL> import json <EOL> import multiprocessing <EOL> import installation <EOL> def config ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def system ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def admin ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def database ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def prereqs ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def paths ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def smtp ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def extensions ( key ) : <EOL> return "<STR_LIT>" + key <EOL> def username ( ) : <EOL> return pwd . getpwuid ( os . getuid ( ) ) . pw_name <EOL> def groupname ( ) : <EOL> return grp . getgrgid ( pwd . getpwuid ( os . getuid ( ) ) . pw_gid ) . gr_name <EOL> def which ( name ) : <EOL> return subprocess . check_output ( "<STR_LIT>" + name , shell = True ) . strip ( ) <EOL> def generate ( arguments , database_path ) : <EOL> data = { config ( "<STR_LIT>" ) : [ installation . config . default_password_hash_scheme ] , <EOL> config ( "<STR_LIT>" ) : installation . config . default_password_hash_scheme , <EOL> config ( "<STR_LIT>" ) : installation . config . minimum_password_hash_time , <EOL> config ( "<STR_LIT>" ) : { installation . config . default_password_hash_scheme : <NUM_LIT:100> } , <EOL> system ( "<STR_LIT:username>" ) : username ( ) , <EOL> system ( "<STR_LIT:email>" ) : username ( ) + "<STR_LIT>" , <EOL> system ( "<STR_LIT>" ) : groupname ( ) , <EOL> admin ( "<STR_LIT:username>" ) : username ( ) , <EOL> admin ( "<STR_LIT:email>" ) : username ( ) + "<STR_LIT>" , <EOL> admin ( "<STR_LIT>" ) : username ( ) , <EOL> system ( "<STR_LIT>" ) : "<STR_LIT:localhost>" , <EOL> system ( "<STR_LIT>" ) : arguments . system_recipient or username ( ) + "<STR_LIT>" , <EOL> config ( "<STR_LIT>" ) : "<STR_LIT>" , <EOL> config ( "<STR_LIT>" ) : "<STR_LIT>" , <EOL> config ( "<STR_LIT>" ) : True , <EOL> config ( "<STR_LIT>" ) : True , <EOL> config ( "<STR_LIT>" ) : arguments . testing , <EOL> config ( "<STR_LIT>" ) : "<STR_LIT:http>" , <EOL> config ( "<STR_LIT>" ) : [ "<STR_LIT:http>" ] , <EOL> config ( "<STR_LIT>" ) : [ "<STR_LIT:utf-8>" , "<STR_LIT>" ] , <EOL> database ( "<STR_LIT>" ) : "<STR_LIT>" , <EOL> database ( "<STR_LIT>" ) : { "<STR_LIT>" : database_path } , <EOL> config ( "<STR_LIT>" ) : True , <EOL> config ( "<STR_LIT>" ) : None , <EOL> prereqs ( "<STR_LIT>" ) : sys . executable , <EOL> prereqs ( "<STR_LIT>" ) : which ( "<STR_LIT>" ) , <EOL> prereqs ( "<STR_LIT>" ) : which ( "<STR_LIT>" ) , <EOL> paths ( "<STR_LIT>" ) : installation . paths . etc_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . install_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . data_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . cache_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . log_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . run_dir , <EOL> paths ( "<STR_LIT>" ) : installation . paths . git_dir , <EOL> smtp ( "<STR_LIT:host>" ) : arguments . smtp_host , <EOL> smtp ( "<STR_LIT:port>" ) : arguments . smtp_port , <EOL> smtp ( "<STR_LIT:username>" ) : json . dumps ( arguments . smtp_username ) , <EOL> smtp ( "<STR_LIT:password>" ) : json . dumps ( arguments . smtp_password ) , <EOL> smtp ( "<STR_LIT>" ) : False , <EOL> smtp ( "<STR_LIT>" ) : False , <EOL> config ( "<STR_LIT>" ) : True , <EOL> config ( "<STR_LIT>" ) : arguments . testing , <EOL> extensions ( "<STR_LIT>" ) : False , <EOL> extensions ( "<STR_LIT>" ) : "<STR_LIT>" , <EOL> extensions ( "<STR_LIT>" ) : "<STR_LIT>" , <EOL> config ( "<STR_LIT>" ) : multiprocessing . cpu_count ( ) , <EOL> config ( "<STR_LIT>" ) : <NUM_LIT:1> , <EOL> config ( "<STR_LIT>" ) : True , <EOL> config ( "<STR_LIT>" ) : "<STR_LIT:none>" } <EOL> def provider ( name ) : <EOL> prefix = "<STR_LIT>" % name <EOL> return { config ( prefix + "<STR_LIT>" ) : False , <EOL> config ( prefix + "<STR_LIT>" ) : False , <EOL> config ( prefix + "<STR_LIT>" ) : False , <EOL> config ( prefix + "<STR_LIT>" ) : None , <EOL> config ( prefix + "<STR_LIT>" ) : None , <EOL> config ( prefix + "<STR_LIT>" ) : False , <EOL> config ( prefix + "<STR_LIT>" ) : None } <EOL> data . update ( provider ( "<STR_LIT>" ) ) <EOL> data . update ( provider ( "<STR_LIT>" ) ) <EOL> return data </s>
