Пример #1
0
def version_callback(ctx, param, value):  # noqa: D103
	# 3rd party
	import repo_helper

	# this package
	from repo_helper_rtd import __version__

	if not value or ctx.resilient_parsing:
		return

	parts = DelimitedList([f"repo_helper_rtd version {__version__}"])

	if value > 1:
		parts.append(f"repo_helper {repo_helper.__version__}")

	click.echo(f"{parts:, }", color=ctx.color)
	ctx.exit()
Пример #2
0
def version_callback(ctx: click.Context, param: click.Option,
                     value: int):  # noqa: D103
    # 3rd party
    import repo_helper

    # this package
    from repo_helper_github import __version__

    if not value or ctx.resilient_parsing:  # pragma: no cover
        return

    parts = DelimitedList([f"repo_helper_github version {__version__}"])

    if value > 1:
        parts.append(f"repo_helper {repo_helper.__version__}")

    click.echo(f"{parts:, }", color=ctx.color)
    ctx.exit()
Пример #3
0
def visit_collapse_node(translator: HTMLTranslator, node: CollapseNode):
	"""
	Visit a :class:`~.CollapseNode`.

	:param translator:
	:param node: The node being visited.
	"""

	tag_parts = DelimitedList(["details"])

	if node.get("names", None):
		names = DelimitedList(node["names"])
		tag_parts.append(f'name="{names: }"')

	if node.get("classes", None):
		classes = DelimitedList(node["classes"])
		tag_parts.append(f'class="{classes: }"')

	translator.body.append(f"<{tag_parts: }>\n<summary>{node.label}</summary>")
	translator.context.append("</details>")
Пример #4
0
def version_callback(ctx: click.Context, param: click.Option,
                     value: int):  # noqa: D103
    if not value or ctx.resilient_parsing:
        return

    # 3rd party
    import virtualenv  # type: ignore
    from domdf_python_tools.stringlist import DelimitedList

    # this package
    import pyproject_devenv

    parts = DelimitedList(
        [f"pyproject-devenv version {pyproject_devenv.__version__}"])

    if value > 1:
        parts.append(f"virualenv {virtualenv.__version__}")

    click.echo(f"{parts:, }", color=ctx.color)
    ctx.exit()