ae-shell 0.3.6__tar.gz → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_shell
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: ae namespace module portion shell: shell execution and environment helpers
5
5
  Home-page: https://gitlab.com/ae-group/ae_shell
6
6
  Author: AndiEcker
@@ -65,13 +65,13 @@ Dynamic: summary
65
65
 
66
66
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
67
67
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
68
- # shell 0.3.6
68
+ # shell 0.3.7
69
69
 
70
70
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
71
71
  https://gitlab.com/ae-group/ae_shell)
72
72
  [![LatestPyPIrelease](
73
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.6?logo=python)](
74
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.6)
73
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.7?logo=python)](
74
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.7)
75
75
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
76
76
  https://pypi.org/project/ae-shell/#history)
77
77
 
@@ -1,12 +1,12 @@
1
1
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
2
2
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
3
- # shell 0.3.6
3
+ # shell 0.3.7
4
4
 
5
5
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
6
6
  https://gitlab.com/ae-group/ae_shell)
7
7
  [![LatestPyPIrelease](
8
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.6?logo=python)](
9
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.6)
8
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.7?logo=python)](
9
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.7)
10
10
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
11
11
  https://pypi.org/project/ae-shell/#history)
12
12
 
@@ -205,7 +205,7 @@ from ae.core import main_app_instance
205
205
  from ae.console import MAIN_SECTION_NAME, ConsoleApp # type: ignore
206
206
 
207
207
 
208
- __version__ = '0.3.6'
208
+ __version__ = '0.3.7'
209
209
 
210
210
 
211
211
  COMMIT_MSG_FILE_NAME = '.commit_msg.txt' #: name of the file containing the commit message
@@ -1045,7 +1045,7 @@ def mask_token(text: list[str]) -> list[str]: ...
1045
1045
  def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
1046
1046
  """ hide most parts of any GitHub/GitHub tokens found in the specified text/-lines.
1047
1047
 
1048
- :param text: text block, specified either as str object or an iterable of str objects (lines),
1048
+ :param text: text block, specified either as str object or as a list of str objects (lines),
1049
1049
  to detect tokens within, to hide/mask the most part of them.
1050
1050
  :return: text block with without the complete tokens.
1051
1051
 
@@ -1060,7 +1060,9 @@ def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
1060
1060
  for idx, line in enumerate(lines):
1061
1061
  while tok_beg in line: # hide the GitLab/GitHub private token, e.g. from git-push-urls with authentication
1062
1062
  start = line.index(tok_beg)
1063
- end = line.index(tok_end, start)
1063
+ end = line.find(tok_end, start)
1064
+ if end == -1:
1065
+ break
1064
1066
  line = line[:start + 3] + "***-masked-token-***" + line[end - 3:]
1065
1067
  lines[idx] = line
1066
1068
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_shell
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: ae namespace module portion shell: shell execution and environment helpers
5
5
  Home-page: https://gitlab.com/ae-group/ae_shell
6
6
  Author: AndiEcker
@@ -65,13 +65,13 @@ Dynamic: summary
65
65
 
66
66
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->
67
67
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
68
- # shell 0.3.6
68
+ # shell 0.3.7
69
69
 
70
70
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
71
71
  https://gitlab.com/ae-group/ae_shell)
72
72
  [![LatestPyPIrelease](
73
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.6?logo=python)](
74
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.6)
73
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.7?logo=python)](
74
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.7)
75
75
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
76
76
  https://pypi.org/project/ae-shell/#history)
77
77
 
@@ -25,13 +25,13 @@ setup_kwargs = {
25
25
  'license': 'GPL-3.0-or-later',
26
26
  'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.101 -->\n'
27
27
  '<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->\n'
28
- '# shell 0.3.6\n'
28
+ '# shell 0.3.7\n'
29
29
  '\n'
30
30
  '[![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](\n'
31
31
  ' https://gitlab.com/ae-group/ae_shell)\n'
32
32
  '[![LatestPyPIrelease](\n'
33
- ' https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.6?logo=python)](\n'
34
- ' https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.6)\n'
33
+ ' https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.7?logo=python)](\n'
34
+ ' https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.7)\n'
35
35
  '[![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](\n'
36
36
  ' https://pypi.org/project/ae-shell/#history)\n'
37
37
  '\n'
@@ -108,7 +108,7 @@ setup_kwargs = {
108
108
  'Source': 'https://ae.readthedocs.io/en/latest/_modules/ae/shell.html'},
109
109
  'python_requires': '>=3.9',
110
110
  'url': 'https://gitlab.com/ae-group/ae_shell',
111
- 'version': '0.3.6',
111
+ 'version': '0.3.7',
112
112
  'zip_safe': True,
113
113
  }
114
114
 
@@ -1453,18 +1453,22 @@ class TestHelpers:
1453
1453
  assert not hint("hint command", _hint_tst_callable.__name__, "extra message")
1454
1454
 
1455
1455
  def test_mask_token(self):
1456
- token = "glpat-gitlab token format ending with an @/ampersand and the gitlab.com domain"
1456
+ token = "glpat-gitlab token format ending at the @/ampersand directly followed by the gitlab.com domain"
1457
1457
  text = "a text block containing a gitlab URL with a token: https://UsaNäm:" + token + "@gitlab.com"
1458
1458
 
1459
1459
  assert token not in mask_token(text)
1460
1460
  assert token not in mask_token([text])[0]
1461
1461
 
1462
- token = "ghp_-github token format ending with an @/ampersand and the github.com domain"
1462
+ token = "ghp_-github token format ending at the @/ampersand directly followed by the github.com domain"
1463
1463
  text = "a text block containing a github URL with a token: https://YouSaNem:" + token + "@github.com"
1464
1464
 
1465
1465
  assert token not in mask_token(text)
1466
1466
  assert token not in mask_token([text])[0]
1467
1467
 
1468
+ text = "skip masking of text blocks with a start token like ghp_ or glpat- but missing end token"
1469
+
1470
+ assert mask_token(text) == text # neither throws str.index()-ValueError nor stuck in endless-loop
1471
+
1468
1472
  def test_owner_project_from_url(self):
1469
1473
  assert owner_project_from_url("owner/project") == "owner/project"
1470
1474
  assert owner_project_from_url("owner/project.git") == "owner/project"
File without changes
File without changes
File without changes