cli2 3.3.4__tar.gz → 3.3.6__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.
Files changed (45) hide show
  1. {cli2-3.3.4/cli2.egg-info → cli2-3.3.6}/PKG-INFO +1 -1
  2. {cli2-3.3.4 → cli2-3.3.6}/cli2/configuration.py +8 -1
  3. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_configuration.py +7 -0
  4. {cli2-3.3.4 → cli2-3.3.6/cli2.egg-info}/PKG-INFO +1 -1
  5. {cli2-3.3.4 → cli2-3.3.6}/setup.py +1 -1
  6. {cli2-3.3.4 → cli2-3.3.6}/MANIFEST.in +0 -0
  7. {cli2-3.3.4 → cli2-3.3.6}/README.rst +0 -0
  8. {cli2-3.3.4 → cli2-3.3.6}/classifiers.txt +0 -0
  9. {cli2-3.3.4 → cli2-3.3.6}/cli2/__init__.py +0 -0
  10. {cli2-3.3.4 → cli2-3.3.6}/cli2/argument.py +0 -0
  11. {cli2-3.3.4 → cli2-3.3.6}/cli2/asyncio.py +0 -0
  12. {cli2-3.3.4 → cli2-3.3.6}/cli2/cli.py +0 -0
  13. {cli2-3.3.4 → cli2-3.3.6}/cli2/client.py +0 -0
  14. {cli2-3.3.4 → cli2-3.3.6}/cli2/colors.py +0 -0
  15. {cli2-3.3.4 → cli2-3.3.6}/cli2/command.py +0 -0
  16. {cli2-3.3.4 → cli2-3.3.6}/cli2/decorators.py +0 -0
  17. {cli2-3.3.4 → cli2-3.3.6}/cli2/display.py +0 -0
  18. {cli2-3.3.4 → cli2-3.3.6}/cli2/entry_point.py +0 -0
  19. {cli2-3.3.4 → cli2-3.3.6}/cli2/example_client.py +0 -0
  20. {cli2-3.3.4 → cli2-3.3.6}/cli2/example_client_complex.py +0 -0
  21. {cli2-3.3.4 → cli2-3.3.6}/cli2/example_nesting.py +0 -0
  22. {cli2-3.3.4 → cli2-3.3.6}/cli2/example_obj.py +0 -0
  23. {cli2-3.3.4 → cli2-3.3.6}/cli2/group.py +0 -0
  24. {cli2-3.3.4 → cli2-3.3.6}/cli2/logging.py +0 -0
  25. {cli2-3.3.4 → cli2-3.3.6}/cli2/node.py +0 -0
  26. {cli2-3.3.4 → cli2-3.3.6}/cli2/overrides.py +0 -0
  27. {cli2-3.3.4 → cli2-3.3.6}/cli2/sphinx.py +0 -0
  28. {cli2-3.3.4 → cli2-3.3.6}/cli2/table.py +0 -0
  29. {cli2-3.3.4 → cli2-3.3.6}/cli2/test.py +0 -0
  30. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_cli.py +0 -0
  31. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_client.py +0 -0
  32. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_command.py +0 -0
  33. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_decorators.py +0 -0
  34. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_display.py +0 -0
  35. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_entry_point.py +0 -0
  36. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_group.py +0 -0
  37. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_inject.py +0 -0
  38. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_node.py +0 -0
  39. {cli2-3.3.4 → cli2-3.3.6}/cli2/test_table.py +0 -0
  40. {cli2-3.3.4 → cli2-3.3.6}/cli2.egg-info/SOURCES.txt +0 -0
  41. {cli2-3.3.4 → cli2-3.3.6}/cli2.egg-info/dependency_links.txt +0 -0
  42. {cli2-3.3.4 → cli2-3.3.6}/cli2.egg-info/entry_points.txt +0 -0
  43. {cli2-3.3.4 → cli2-3.3.6}/cli2.egg-info/requires.txt +0 -0
  44. {cli2-3.3.4 → cli2-3.3.6}/cli2.egg-info/top_level.txt +0 -0
  45. {cli2-3.3.4 → cli2-3.3.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cli2
3
- Version: 3.3.4
3
+ Version: 3.3.6
4
4
  Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
5
5
  Home-page: https://yourlabs.io/oss/cli2
6
6
  Author: James Pic
@@ -85,7 +85,7 @@ class Configuration(dict):
85
85
  value = input(prompt + '\n> ')
86
86
  confirm = None
87
87
  while confirm not in ('', 'y', 'Y', 'n'):
88
- confirm = input(f'Confirm value of:\n{value}?\n(Y/n) >')
88
+ confirm = input(f'Confirm value of:\n{value}\n(Y/n) >')
89
89
  if confirm in ('', 'y', 'Y'):
90
90
  # user is satisfied
91
91
  return value
@@ -158,8 +158,15 @@ class Configuration(dict):
158
158
  escaped_value = shlex.quote(value)
159
159
  with self.profile_path.open('a') as f:
160
160
  f.write(f'\nexport {key}={escaped_value}')
161
+ self.print(
162
+ f'Appended to {self.profile_path}:'
163
+ f'\nexport {key}={escaped_value}'
164
+ )
161
165
  return value
162
166
 
167
+ def print(self, *args, **kwargs):
168
+ print(*args, **kwargs)
169
+
163
170
  def delete(self, key, reason=None):
164
171
  """
165
172
  Delete a variable from everywhere, useful if an api key expired.
@@ -7,10 +7,14 @@ class Configuration(cli2.Configuration):
7
7
  def __init__(self, *args, **kwargs):
8
8
  super().__init__(*args, **kwargs)
9
9
  self.expected_prompts = dict()
10
+ self.prints = []
10
11
 
11
12
  def input(self, prompt):
12
13
  return self.expected_prompts.pop(prompt)
13
14
 
15
+ def print(self, *args, **kwargs):
16
+ self.prints.append((args, kwargs))
17
+
14
18
 
15
19
  def test_idempotent(tmp_path):
16
20
  profile_path = tmp_path / 'bashrc'
@@ -68,3 +72,6 @@ def test_idempotent(tmp_path):
68
72
  '''
69
73
  cfg.expected_prompts['Test\nFor\nDedent'] = 'success'
70
74
  assert cfg['TEST'] == 'success'
75
+ assert cfg.prints[0][0][0] == (
76
+ f'Appended to {cfg.profile_path}:\nexport TEST=success'
77
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cli2
3
- Version: 3.3.4
3
+ Version: 3.3.6
4
4
  Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
5
5
  Home-page: https://yourlabs.io/oss/cli2
6
6
  Author: James Pic
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
 
4
4
  setup(
5
5
  name='cli2',
6
- version='3.3.4',
6
+ version='3.3.6',
7
7
  setup_requires='setupmeta',
8
8
  install_requires=[
9
9
  'docstring_parser',
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