Example #1
0
def server_cmd(ctx, host, port, output_path, prune, verbosity, extra_flags,
               build_flags, browse):
    """The server command will launch a local server for development.

    Lektor's development server will automatically build all files into
    pages similar to how the build command with the `--watch` switch
    works, but also at the same time serve up the website on a local
    HTTP server.
    """
    from lektor.devserver import run_server
    extra_flags = tuple(itertools.chain(extra_flags or (), build_flags or ()))
    if output_path is None:
        output_path = ctx.get_default_output_path()
    ctx.load_plugins()
    click.echo(' * Project path: %s' % ctx.get_project().project_path)
    click.echo(' * Output path: %s' % output_path)
    run_server((host, port),
               env=ctx.get_env(),
               output_path=output_path,
               prune=prune,
               verbosity=verbosity,
               ui_lang=ctx.ui_lang,
               extra_flags=extra_flags,
               lektor_dev=os.environ.get('LEKTOR_DEV') == '1',
               browse=browse)
Example #2
0
def server_cmd(ctx, host, port, output_path, verbosity, build_flags, browse):
    """The server command will launch a local server for development.

    Lektor's development server will automatically build all files into
    pages similar to how the build command with the `--watch` switch
    works, but also at the same time serve up the website on a local
    HTTP server.
    """
    from lektor.devserver import run_server

    if output_path is None:
        output_path = ctx.get_default_output_path()
    ctx.load_plugins()
    click.echo(" * Project path: %s" % ctx.get_project().project_path)
    click.echo(" * Output path: %s" % output_path)
    run_server(
        (host, port),
        env=ctx.get_env(),
        output_path=output_path,
        verbosity=verbosity,
        ui_lang=ctx.ui_lang,
        build_flags=build_flags,
        lektor_dev=os.environ.get("LEKTOR_DEV") == "1",
        browse=browse,
    )
Example #3
0
def serve(ctx):
    lektor_cli_ctx = Context()
    lektor_cli_ctx.load_plugins()

    env = lektor_cli_ctx.get_env()
    run_server(
        ('127.0.0.1', 5000), env=env, output_path=OUTPUT_DIR, verbosity=0,
    )
Example #4
0
File: cli.py Project: jab/lektor
def devserver_cmd(ctx, host, port, output_path, verbosity, browse):
    """The devserver command will launch a local server for development.

    Lektor's developemnt server will automatically build all files into
    pages similar to how the build command with the `--watch` switch
    works, but also at the same time serve up the website on a local
    HTTP server.
    """
    from lektor.devserver import run_server
    if output_path is None:
        output_path = ctx.get_default_output_path()
    print ' * Tree path: %s' % ctx.get_tree()
    print ' * Output path: %s' % output_path
    run_server((host, port), env=ctx.get_env(), output_path=output_path,
               verbosity=verbosity,
               lektor_dev=os.environ.get('LEKTOR_DEV') == '1',
               browse=browse)
Example #5
0
File: cli.py Project: jab/lektor
def devserver_cmd(ctx, host, port, output_path, verbosity, browse):
    """The devserver command will launch a local server for development.

    Lektor's developemnt server will automatically build all files into
    pages similar to how the build command with the `--watch` switch
    works, but also at the same time serve up the website on a local
    HTTP server.
    """
    from lektor.devserver import run_server
    if output_path is None:
        output_path = ctx.get_default_output_path()
    print ' * Tree path: %s' % ctx.get_tree()
    print ' * Output path: %s' % output_path
    run_server((host, port),
               env=ctx.get_env(),
               output_path=output_path,
               verbosity=verbosity,
               lektor_dev=os.environ.get('LEKTOR_DEV') == '1',
               browse=browse)