Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
rabotnik
rcom
Commits
25bf1c77
Commit
25bf1c77
authored
Apr 30, 2021
by
Felix Delattre
Browse files
Renamed rcli to rabotai
parent
ca959b4f
Pipeline
#22540
passed with stage
in 3 minutes and 2 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
25bf1c77
...
...
@@ -19,7 +19,7 @@ test:
coverage
:
script
:
-
pytest --cov=r
cl
i/ tests/
-
pytest --cov=r
abota
i/ tests/
-
coverage xml
artifacts
:
reports
:
...
...
r
cl
i/__init__.py
→
r
abota
i/__init__.py
View file @
25bf1c77
File moved
r
cl
i/argument_base.py
→
r
abota
i/argument_base.py
View file @
25bf1c77
File moved
r
cl
i/argument_factory.py
→
r
abota
i/argument_factory.py
View file @
25bf1c77
File moved
r
cl
i/arguments/__init__.py
→
r
abota
i/arguments/__init__.py
View file @
25bf1c77
File moved
r
cl
i/arguments/building_id.py
→
r
abota
i/arguments/building_id.py
View file @
25bf1c77
File moved
r
cl
i/arguments/building_ids_file.py
→
r
abota
i/arguments/building_ids_file.py
View file @
25bf1c77
File moved
r
cli/rcl
i.py
→
r
abotai/rabota
i.py
View file @
25bf1c77
...
...
@@ -28,15 +28,15 @@ from .argument_factory import ArgumentFactory
logger
=
logging
.
getLogger
(
__name__
)
class
R
CL
I
:
"""The Rabotnik Command-Line Interface (R
CL
I).
class
R
ABOTA
I
:
"""The Rabotnik Command-Line Interface (R
ABOTA
I).
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 r
cl
i.
arguments: The arguments that are made available in the r
abota
i.
"""
def
__init__
(
self
,
parser
:
argparse
.
ArgumentParser
):
...
...
@@ -73,7 +73,7 @@ class RCLI:
def
main
(
args
:
list
=
None
,
message_bus
:
MessageBus
=
None
):
"""R
CL
I entry point.
"""R
ABOTA
I 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
()
r
cli
=
RCL
I
(
parser
=
parser
)
r
cl
i
.
setup_parser
()
r
abotai
=
RABOTA
I
(
parser
=
parser
)
r
abota
i
.
setup_parser
()
group
=
parser
.
add_argument_group
(
"message bus"
)
...
...
@@ -131,9 +131,9 @@ def main(args: list = None, message_bus: MessageBus = None):
)
)
r
cl
i
.
set_message_bus
(
message_bus
)
r
abota
i
.
set_message_bus
(
message_bus
)
# Parse `args` to dictionary.
args_dict
=
vars
(
args
)
loop
.
run_until_complete
(
r
cl
i
.
execute
(
args_dict
))
loop
.
run_until_complete
(
r
abota
i
.
execute
(
args_dict
))
setup.py
View file @
25bf1c77
...
...
@@ -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,18 @@ tests_require = [
linters_require
=
[
"pylint"
,
"pre-commit"
]
setup
(
name
=
"r
cl
i"
,
version
=
version
,
name
=
"r
abota
i"
,
version
=
"0.0.3"
,
description
=
"Rabotnik command-line interface"
,
author
=
"Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ"
,
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"
:
[
"r
cli = rcli.rcl
i:main"
]},
entry_points
=
{
"console_scripts"
:
[
"r
abotai = rabotai.rabota
i:main"
]},
packages
=
find_packages
(),
python_requires
=
">=3.6"
,
)
tests/test_arguments.py
View file @
25bf1c77
...
...
@@ -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
r
cl
i.argument_base
import
ArgumentBase
from
r
abota
i.argument_base
import
ArgumentBase
def
test_get_format_argument
():
...
...
tests/test_r
cl
i.py
→
tests/test_r
abota
i.py
View file @
25bf1c77
...
...
@@ -20,7 +20,7 @@ import asyncio
import
pytest
import
argparse
from
r
cli.rcl
i
import
R
CL
I
from
r
abotai.rabota
i
import
R
ABOTA
I
class
MockMessageBus
:
...
...
@@ -34,19 +34,19 @@ class MockMessageBus:
@
pytest
.
mark
.
asyncio
async
def
test_r
cl
i
():
async
def
test_r
abota
i
():
message_bus
=
MockMessageBus
()
parser
=
argparse
.
ArgumentParser
()
r
cli
=
RCL
I
(
parser
=
parser
)
r
cl
i
.
set_message_bus
(
message_bus
)
r
abotai
=
RABOTA
I
(
parser
=
parser
)
r
abota
i
.
set_message_bus
(
message_bus
)
r
cl
i
.
setup_parser
()
r
abota
i
.
setup_parser
()
help_formatted
=
parser
.
format_help
()
assert
help_formatted
.
startswith
(
"usage:"
)
arguments
=
{
"building_id"
:
"1"
}
await
r
cl
i
.
execute
(
arguments
)
await
r
abota
i
.
execute
(
arguments
)
assert
message_bus
.
calls
==
[((),
{
"message"
:
"building"
,
"payload"
:
{
"building_id"
:
"1"
}})]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment