MCPcopy
hub / github.com/lektor/lektor / plugins_remove_cmd

Function plugins_remove_cmd

lektor/cli.py:502–525  ·  view source on GitHub ↗

This command can remove a plugin to the project again. The name of the plugin is the only argument to the function.

(ctx, name)

Source from the content-addressed store, hash-verified

500@click.argument("name")
501@pass_context
502def plugins_remove_cmd(ctx, name):
503 """This command can remove a plugin to the project again. The name
504 of the plugin is the only argument to the function.
505 """
506 project = ctx.get_project()
507 from .packages import remove_package_from_project
508
509 try:
510 old_info = remove_package_from_project(project, name)
511 except RuntimeError as e:
512 click.echo("Error: %s" % e, err=True)
513 else:
514 if old_info is None:
515 click.echo(
516 "Package was not registered with the project. " "Nothing was removed."
517 )
518 else:
519 click.echo(
520 "Removed package %s (%s)"
521 % (
522 old_info["name"],
523 old_info["version"],
524 )
525 )
526
527
528@plugins_cmd.command("list", short_help="List all plugins.")

Callers

nothing calls this directly

Calls 2

get_projectMethod · 0.80

Tested by

no test coverage detected