Commit 140a8244 authored by Felix Delattre's avatar Felix Delattre
Browse files

Renamed rcli to rcom

parent ca959b4f
Pipeline #22622 passed with stage
in 2 minutes and 15 seconds
......@@ -19,7 +19,7 @@ test:
coverage:
script:
- pytest --cov=rcli/ tests/
- pytest --cov=rcom/ tests/
- coverage xml
artifacts:
reports:
......
===============================
rabotnik command line interface
===============================
=======
rcom
=======
A command line interface for `rabotnik <https://git.gfz-potsdam.de/dynamicexposure/rabotnik/rabotnik>`__.
Copyright and copyleft
----------------------
......
......@@ -28,15 +28,15 @@ from .argument_factory import ArgumentFactory
logger = logging.getLogger(__name__)
class RCLI:
"""The Rabotnik Command-Line Interface (RCLI).
class RCOM:
"""The Rabotnik Command-Line Interface (RCOM).
Communicate with nodes running within the `rabotnik` ecosystem via the `message_bus`.
Args:
parser: Creates and parses command line arguments.
Attributes:
arguments: The arguments that are made available in the rcli.
arguments: The arguments that are made available in the rcom.
"""
def __init__(self, parser: argparse.ArgumentParser):
......@@ -73,7 +73,7 @@ class RCLI:
def main(args: list = None, message_bus: MessageBus = None):
"""RCLI entry point.
"""RCOM entry point.
Args:
args: List of arguments. If not provided, read arguments from commandline
......@@ -88,8 +88,8 @@ def main(args: list = None, message_bus: MessageBus = None):
args = args or sys.argv[1:]
parser = argparse.ArgumentParser()
rcli = RCLI(parser=parser)
rcli.setup_parser()
rcom = RCOM(parser=parser)
rcom.setup_parser()
group = parser.add_argument_group("message bus")
......@@ -131,9 +131,9 @@ def main(args: list = None, message_bus: MessageBus = None):
)
)
rcli.set_message_bus(message_bus)
rcom.set_message_bus(message_bus)
# Parse `args` to dictionary.
args_dict = vars(args)
loop.run_until_complete(rcli.execute(args_dict))
loop.run_until_complete(rcom.execute(args_dict))
......@@ -17,12 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from setuptools import setup, find_packages
with open(os.path.join("VERSION")) as version_file:
version = version_file.read().strip()
tests_require = [
"pytest",
"pytest-asyncio",
......@@ -33,18 +29,19 @@ tests_require = [
linters_require = ["pylint", "pre-commit"]
setup(
name="rcli",
version=version,
description="Rabotnik command-line interface",
name="rcom",
version="0.0.3",
description="A command line interface for rabotnik.",
author="Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ",
url="https://git.gfz-potsdam.de/dynamicexposure/rabotnik/rcom",
license="AGPLv3+",
install_requires=["rabotnik==0.0.2"],
install_requires=["rabotnik==0.0.3"],
tests_require=tests_require,
extras_require={
"tests": tests_require,
"linters": linters_require,
},
entry_points={"console_scripts": ["rcli = rcli.rcli:main"]},
entry_points={"console_scripts": ["rcom = rcom.rcom:main"]},
packages=find_packages(),
python_requires=">=3.6",
)
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
from rcli.argument_base import ArgumentBase
from rcom.argument_base import ArgumentBase
def test_get_format_argument():
......
......@@ -20,7 +20,7 @@ import asyncio
import pytest
import argparse
from rcli.rcli import RCLI
from rcom.rcom import RCOM
class MockMessageBus:
......@@ -34,19 +34,19 @@ class MockMessageBus:
@pytest.mark.asyncio
async def test_rcli():
async def test_rcom():
message_bus = MockMessageBus()
parser = argparse.ArgumentParser()
rcli = RCLI(parser=parser)
rcli.set_message_bus(message_bus)
rcom = RCOM(parser=parser)
rcom.set_message_bus(message_bus)
rcli.setup_parser()
rcom.setup_parser()
help_formatted = parser.format_help()
assert help_formatted.startswith("usage:")
arguments = {"building_id": "1"}
await rcli.execute(arguments)
await rcom.execute(arguments)
assert message_bus.calls == [((), {"message": "building", "payload": {"building_id": "1"}})]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment