MCPcopy
hub / github.com/lektor/lektor / plugins_add_cmd

Function plugins_add_cmd

lektor/cli.py:473–496  ·  view source on GitHub ↗

This command can add a new plugin to the project. If just given the name of the plugin the latest version of that plugin is added to the project. The argument is either the name of the plugin or the name of the plugin suffixed with `@version` with the version. For instance to inst

(ctx, name)

Source from the content-addressed store, hash-verified

471@click.argument("name")
472@pass_context
473def plugins_add_cmd(ctx, name):
474 """This command can add a new plugin to the project. If just given
475 the name of the plugin the latest version of that plugin is added to
476 the project.
477
478 The argument is either the name of the plugin or the name of the plugin
479 suffixed with `@version` with the version. For instance to install
480 the version 0.1 of the plugin demo you would do `demo@0.1`.
481 """
482 project = ctx.get_project()
483 from .packages import add_package_to_project
484
485 try:
486 info = add_package_to_project(project, name)
487 except RuntimeError as e:
488 click.echo("Error: %s" % e, err=True)
489 else:
490 click.echo(
491 "Package %s (%s) was added to the project"
492 % (
493 info["name"],
494 info["version"],
495 )
496 )
497
498
499@plugins_cmd.command("remove", short_help="Removes a plugin from the project.")

Callers

nothing calls this directly

Calls 2

add_package_to_projectFunction · 0.85
get_projectMethod · 0.80

Tested by

no test coverage detected