cli2 4.2.0__tar.gz → 4.2.1__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.2.0/cli2.egg-info → cli2-4.2.1}/PKG-INFO +1 -1
- {cli2-4.2.0 → cli2-4.2.1}/cli2/client.py +11 -0
- {cli2-4.2.0 → cli2-4.2.1/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-4.2.0 → cli2-4.2.1}/setup.py +1 -1
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_client.py +2 -0
- {cli2-4.2.0 → cli2-4.2.1}/MANIFEST.in +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/README.rst +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/classifiers.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/__init__.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/ansible/__init__.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/ansible/action.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/ansible/playbook.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/ansible/variables.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/asyncio.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/cli.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/cli2.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/colors.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/configuration.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/decorators.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/display.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/__init__.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/client.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/conf.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/example.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/example_obj.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/nesting.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/obj.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/obj2.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/examples/test.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/lock.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/log.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/node.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/sphinx.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/table.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2/test.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2.egg-info/requires.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/cli2.egg-info/top_level.txt +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/setup.cfg +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_ansible.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_ansible_variables.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_asyncio.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_cli.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_command.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_configuration.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_decorators.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_display.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_entry_point.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_group.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_inject.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_lock.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_node.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_restful.py +0 -0
- {cli2-4.2.0 → cli2-4.2.1}/tests/test_table.py +0 -0
|
@@ -661,6 +661,7 @@ class ModelCommand(Command):
|
|
|
661
661
|
super().__init__(target, *args, **kwargs)
|
|
662
662
|
self.overrides['self']['factory'] = self.get_object
|
|
663
663
|
self.overrides['cls']['factory'] = self.get_model
|
|
664
|
+
self.client = None
|
|
664
665
|
|
|
665
666
|
def setargs(self):
|
|
666
667
|
"""
|
|
@@ -1263,6 +1264,9 @@ class ClientCommand(Command):
|
|
|
1263
1264
|
|
|
1264
1265
|
The client object that was constructed from :py:meth:`Client.factory`
|
|
1265
1266
|
"""
|
|
1267
|
+
def __init__(self, *args, **kwargs):
|
|
1268
|
+
super().__init__(*args, **kwargs)
|
|
1269
|
+
self.client = None
|
|
1266
1270
|
|
|
1267
1271
|
def setargs(self):
|
|
1268
1272
|
"""
|
|
@@ -1391,6 +1395,13 @@ class Client(metaclass=ClientMetaclass):
|
|
|
1391
1395
|
:param cmd: :py:class:`ClientCommand` object
|
|
1392
1396
|
"""
|
|
1393
1397
|
|
|
1398
|
+
async def post_call(self, cmd):
|
|
1399
|
+
"""
|
|
1400
|
+
Override this method which will run after a CLI exits.
|
|
1401
|
+
|
|
1402
|
+
:param cmd: :py:class:`ClientCommand` object
|
|
1403
|
+
"""
|
|
1404
|
+
|
|
1394
1405
|
@property
|
|
1395
1406
|
def client(self):
|
|
1396
1407
|
"""
|
|
@@ -1178,6 +1178,7 @@ def test_client_command(client_class, httpx_mock):
|
|
|
1178
1178
|
|
|
1179
1179
|
assert 'get' in Client.cli['model']
|
|
1180
1180
|
|
|
1181
|
+
assert Client.cli['get'].client is None
|
|
1181
1182
|
cmd = Client.cli['get']
|
|
1182
1183
|
assert isinstance(cmd, Client.cmdclass)
|
|
1183
1184
|
httpx_mock.add_response(url='http://x/foo', json=[])
|
|
@@ -1187,5 +1188,6 @@ def test_client_command(client_class, httpx_mock):
|
|
|
1187
1188
|
|
|
1188
1189
|
httpx_mock.add_response(url='http://x/foo', json=[])
|
|
1189
1190
|
httpx_mock.add_response(url='http://x/logoff')
|
|
1191
|
+
assert Client.cli['model']['get'].client is None
|
|
1190
1192
|
cmd = Client.cli['model']['find']
|
|
1191
1193
|
cmd('http://x')
|
|
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
|