示例#1
0
def main():
    os.environ['LEAPP_HOSTNAME'] = socket.getfqdn()
    load_commands()
    cli.command.execute(version=_('snactor version {}').format(VERSION))
示例#2
0
import os
import pkgutil
import socket

from leapp.utils.i18n import _  # noqa; pylint: disable=redefined-builtin
from leapp.snactor import commands
from leapp.snactor.commands import workflow
from leapp.snactor.commands import messages
from leapp.snactor.commands import repo
from leapp.utils.clicmd import command, command_opt
from leapp.utils.repository import find_repository_basedir
from leapp import VERSION

SHORT_HELP = _(
    "snactor is a development and repository management tool for Leapp.")
LONG_HELP = _(
    """Snactor is designed to get quickly started with leapp actor development."""
)


def load_commands():
    _load_commands_from(commands.__file__)
    _load_commands_from(commands.workflow.__file__)
    _load_commands_from(commands.messages.__file__)
    _load_commands_from(commands.repo.__file__)
    cli.command.add_sub(messages.messages.command)
    cli.command.add_sub(workflow.workflow.command)
    cli.command.add_sub(repo.repo.command)


def _load_commands_from(path):