()
Build default configuration file
Build default configuration file
Build default configuration file
def build_configuration_file():
    """Build default configuration file """

    timezone = prompt("""
Which time zone do you want for your database (default is Europe/Paris,
Check Newebe wiki for timezone list) ?
\n \n
""")
    if not timezone:
        timezone = "Europe/Paris"

    with cd(newebe_conf_dir):
        delete_if_exists('local_settings.py')
        newebedo('echo "main:" >> config.yaml')
        newebedo('echo "    port: 8282" >> config.yaml')
        newebedo('echo "    debug: False" >> config.yaml')
        newebedo('echo "    timezone: \"%s\" >> config.yaml"' % timezone)
        newebedo('echo "    path: \"%s\" >> config.yaml"' % newebe_dir)
        newebedo('echo "    logpath: \"%s\" >> config.yaml"' % newebe_log_dir)
        newebedo('echo "db:" >> config.yaml')
        newebedo("echo '    name: \"newebe\"' >> config.yaml")
        newebedo('echo "security:" >> config.yaml')
        newebedo('echo "    certificate: "%s/certs/server.crt"' % newebe_conf_dir)
        newebedo('echo "    private_key: "%s/certs/server.key"' % newebe_conf_dir)
        newebedo("echo '    cookie_key: \"%s\"' >> config.yaml" % \
                 random_string(42))
def build_configuration_file ( ) : timezone = prompt ( """
Which time zone do you want for your database (default is Europe/Paris,
Check Newebe wiki for timezone list) ?
\n \n
""" ) if not timezone : timezone = "Europe/Paris" with cd ( newebe_conf_dir ) : delete_if_exists ( 'local_settings.py' ) newebedo ( 'echo "main:" >> config.yaml' ) newebedo ( 'echo "    port: 8282" >> config.yaml' ) newebedo ( 'echo "    debug: False" >> config.yaml' ) newebedo ( 'echo "    timezone: \"%s\" >> config.yaml"' % timezone ) newebedo ( 'echo "    path: \"%s\" >> config.yaml"' % newebe_dir ) newebedo ( 'echo "    logpath: \"%s\" >> config.yaml"' % newebe_log_dir ) newebedo ( 'echo "db:" >> config.yaml' ) newebedo ( "echo '    name: \"newebe\"' >> config.yaml" ) newebedo ( 'echo "security:" >> config.yaml' ) newebedo ( 'echo "    certificate: "%s/certs/server.crt"' % newebe_conf_dir ) newebedo ( 'echo "    private_key: "%s/certs/server.key"' % newebe_conf_dir ) newebedo ( "echo '    cookie_key: \"%s\"' >> config.yaml" % random_string ( 42 ) )