cli2 4.0.6__tar.gz → 4.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli2-4.0.6/cli2.egg-info → cli2-4.0.7}/PKG-INFO +1 -1
- {cli2-4.0.6 → cli2-4.0.7}/cli2/client.py +16 -0
- {cli2-4.0.6 → cli2-4.0.7/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-4.0.6 → cli2-4.0.7}/setup.py +1 -1
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_client.py +10 -0
- {cli2-4.0.6 → cli2-4.0.7}/MANIFEST.in +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/README.rst +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/classifiers.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/__init__.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/ansible/__init__.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/ansible/action.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/ansible/playbook.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/ansible/pytest.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/ansible/variables.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/asyncio.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/cli.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/cli2.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/colors.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/configuration.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/decorators.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/display.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/__init__.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/client.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/conf.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/example.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/example_obj.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/nesting.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/obj.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/obj2.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/examples/test.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/lock.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/log.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/node.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/sphinx.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/table.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2/test.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2.egg-info/requires.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/cli2.egg-info/top_level.txt +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/setup.cfg +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_ansible.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_ansible_variables.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_cli.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_command.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_configuration.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_decorators.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_display.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_entry_point.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_group.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_inject.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_lock.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_node.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_restful.py +0 -0
- {cli2-4.0.6 → cli2-4.0.7}/tests/test_table.py +0 -0
|
@@ -956,6 +956,8 @@ class ClientMetaclass(type):
|
|
|
956
956
|
self=dict(factory=lambda: cls())
|
|
957
957
|
),
|
|
958
958
|
)
|
|
959
|
+
if new_kwargs := getattr(cls, 'cli2', None):
|
|
960
|
+
cli_kwargs.update(new_kwargs)
|
|
959
961
|
cli_kwargs.update(cls.__dict__.get('cli_kwargs', dict()))
|
|
960
962
|
cls.cli = Group(**cli_kwargs)
|
|
961
963
|
cls.cli.load(cls)
|
|
@@ -1204,6 +1206,20 @@ class Client(metaclass=ClientMetaclass):
|
|
|
1204
1206
|
|
|
1205
1207
|
List of keys to mask in logging, ie.: ``['password', 'secret']``
|
|
1206
1208
|
|
|
1209
|
+
.. py:attribute:: cli
|
|
1210
|
+
|
|
1211
|
+
Generated :py:class:`~cli2.cli.Group` for this client.
|
|
1212
|
+
|
|
1213
|
+
.. py:attribute:: cli2
|
|
1214
|
+
|
|
1215
|
+
Dict of overrides for the generated :py:class:`~cli2.cli.Group`.
|
|
1216
|
+
Example:
|
|
1217
|
+
|
|
1218
|
+
.. code-block:: python
|
|
1219
|
+
|
|
1220
|
+
class YourClient(cli2.Client):
|
|
1221
|
+
cli2 = dict(cmdclass=YourCommandClass)
|
|
1222
|
+
|
|
1207
1223
|
.. py:attribute:: debug
|
|
1208
1224
|
|
|
1209
1225
|
Enforce full logging: quiet requests are logged, masking does not
|
|
@@ -1135,3 +1135,13 @@ async def test_client_token_apply(client_class, httpx_mock):
|
|
|
1135
1135
|
await client.client_reset()
|
|
1136
1136
|
assert client.token == 2
|
|
1137
1137
|
assert client.client.token == 2
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
def test_client_kwargs(client_class):
|
|
1141
|
+
class TestCmd(cli2.Command):
|
|
1142
|
+
pass
|
|
1143
|
+
|
|
1144
|
+
class TestClient(client_class):
|
|
1145
|
+
cli2 = dict(cmdclass=TestCmd)
|
|
1146
|
+
|
|
1147
|
+
assert TestClient.cli.cmdclass == TestCmd
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|