Skip to content

Commit 71d6f60

Browse files
committed
refactor(cli): move cli automatoes to cli cli
Refs: #38
1 parent 29f66bb commit 71d6f60

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

automatoes/bin/automatoes-cli.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
2-
# -*- coding: UTF-8 -*-
32
#
4-
# Copyright 2019-2023 Flavio Garcia
3+
# Copyright 2019-2024 Flavio Garcia
54
#
65
# Licensed under the Apache License, Version 2.0 (the "License");
76
# you may not use this file except in compliance with the License.
@@ -15,7 +14,7 @@
1514
# See the License for the specific language governing permissions and
1615
# limitations under the License.
1716

18-
from automatoes.cli.automatoes import automatoes_cli
17+
from automatoes.cli.cli import automatoes_cli
1918

2019

2120
if __name__ == "__main__":

automatoes/cli/__init__.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"""
1919
The command line interface.
2020
"""
21-
from .. import get_version, messages
22-
from ..authorize import authorize
23-
from ..issue import issue
24-
from ..info import info
25-
from ..migrate import migrate
26-
from ..model import Account
27-
from ..register import register
28-
from ..revoke import revoke
29-
from ..upgrade import upgrade
30-
from ..errors import AutomatoesError
21+
from automatoes import get_version, messages
22+
from automatoes.authorize import authorize
23+
from automatoes.issue import issue
24+
from automatoes.info import info
25+
from automatoes.migrate import migrate
26+
from automatoes.model import Account
27+
from automatoes.register import register
28+
from automatoes.revoke import revoke
29+
from automatoes.upgrade import upgrade
30+
from automatoes.errors import AutomatoesError
3131

3232
import argparse
3333
from cartola import sysexits

automatoes/cli/automatoes.py automatoes/cli/cli.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# -*- coding: UTF-8 -*-
2-
#
3-
# Copyright 2019-2023 Flávio Gonçalves Garcia
1+
# Copyright 2019-2024 Flavio Garcia
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");
64
# you may not use this file except in compliance with the License.
@@ -14,10 +12,10 @@
1412
# See the License for the specific language governing permissions and
1513
# limitations under the License.
1614

17-
from . import DEFAULT_ACCOUNT_PATH, LETS_ENCRYPT_PRODUCTION
18-
from . import load_account
19-
from .. import messages
20-
from ..errors import AutomatoesError
15+
from automatoes.cli import DEFAULT_ACCOUNT_PATH, LETS_ENCRYPT_PRODUCTION
16+
from automatoes.cli import load_account
17+
from automatoes import messages
18+
from automatoes.errors import AutomatoesError
2119

2220
from cartola import config, sysexits
2321
import click
@@ -53,9 +51,10 @@ def account_files(self):
5351

5452
pass_context = click.make_pass_decorator(AutomatoesCliContext,
5553
ensure=True)
54+
config = config.load_yaml_file(AUTOMATOES_CONFIG_FILE)
5655

5756

58-
@taskio.root(taskio_conf=config.load_yaml_file(AUTOMATOES_CONFIG_FILE))
57+
@taskio.root(root="taskio", taskio_conf=config)
5958
@click.option("-a", "--account", help=messages.OPTION_ACCOUNT_HELP,
6059
default=DEFAULT_ACCOUNT_PATH, show_default=True)
6160
@click.option("-s", "--server", help=messages.OPTION_SERVER_HELP,

automatoes/cli/commands/help.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
from ..automatoes import AutomatoesCliContext, pass_context
17+
from automatoes.cli.cli import AutomatoesCliContext, pass_context
1818
import click
1919

2020

automatoes/conf/automatoes.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
taskio:
22
program:
3-
name: automatoes
3+
name: Candango Automatoes
44
version: automatoes.get_version
55
sources:
66
- automatoes.cli.commands.account

0 commit comments

Comments
 (0)