python-kacl 0.7.2__py3-none-any.whl → 0.7.3__py3-none-any.whl
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.
- kacl/__init__.py +1 -1
- kacl/document.py +6 -2
- kacl/kacl_cli.py +14 -5
- kacl/serializer.py +20 -2
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/METADATA +1 -1
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/RECORD +10 -10
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/WHEEL +0 -0
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/entry_points.txt +0 -0
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/licenses/LICENSE +0 -0
- {python_kacl-0.7.2.dist-info → python_kacl-0.7.3.dist-info}/top_level.txt +0 -0
kacl/__init__.py
CHANGED
kacl/document.py
CHANGED
|
@@ -205,7 +205,7 @@ class KACLDocument:
|
|
|
205
205
|
try:
|
|
206
206
|
v0 = versions[i]
|
|
207
207
|
v1 = versions[i + 1]
|
|
208
|
-
if semver.
|
|
208
|
+
if semver.compare(v0.version(), v1.version()) < 1:
|
|
209
209
|
validation.add_error(
|
|
210
210
|
line=v1.raw(),
|
|
211
211
|
line_number=v1.line_number(),
|
|
@@ -502,7 +502,11 @@ class KACLDocument:
|
|
|
502
502
|
|
|
503
503
|
if auto_link:
|
|
504
504
|
link_provider = self.__get_link_provider()
|
|
505
|
-
|
|
505
|
+
# Only process the versions we just added/modified
|
|
506
|
+
# If add_unreleased=True: process Unreleased (index 0) and new version (index 1)
|
|
507
|
+
# If add_unreleased=False: only process new version (index 0)
|
|
508
|
+
versions_to_link = 2 if self.config.add_unreleased else 1
|
|
509
|
+
for i in range(versions_to_link):
|
|
506
510
|
fargs = {
|
|
507
511
|
"version": self.__versions[i].version(),
|
|
508
512
|
"previous_version": None,
|
kacl/kacl_cli.py
CHANGED
|
@@ -244,7 +244,12 @@ def next(ctx, version):
|
|
|
244
244
|
is_flag=True,
|
|
245
245
|
help="This option suppresses a link, even if available.",
|
|
246
246
|
)
|
|
247
|
-
|
|
247
|
+
@click.option(
|
|
248
|
+
"--no-header",
|
|
249
|
+
is_flag=True,
|
|
250
|
+
help="This option suppresses the header and link.",
|
|
251
|
+
)
|
|
252
|
+
def get(ctx, version, no_link, no_header):
|
|
248
253
|
"""Returns a given version from the Changelog."""
|
|
249
254
|
kacl_changelog = load_changelog(ctx)
|
|
250
255
|
|
|
@@ -252,10 +257,14 @@ def get(ctx, version, no_link):
|
|
|
252
257
|
kacl_version = kacl_changelog.get(version)
|
|
253
258
|
|
|
254
259
|
if kacl_version:
|
|
255
|
-
if
|
|
256
|
-
kacl_version.
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
if no_header:
|
|
261
|
+
kacl_changelog_content = kacl.dump(kacl_version.sections())
|
|
262
|
+
click.echo(kacl_changelog_content)
|
|
263
|
+
else:
|
|
264
|
+
if no_link:
|
|
265
|
+
kacl_version.set_link(None)
|
|
266
|
+
kacl_changelog_content = kacl.dump(kacl_version)
|
|
267
|
+
click.echo(kacl_changelog_content)
|
|
259
268
|
else:
|
|
260
269
|
click.echo(
|
|
261
270
|
click.style("Error: ", fg="red")
|
kacl/serializer.py
CHANGED
|
@@ -36,6 +36,15 @@ class KACLMarkdownSerializer:
|
|
|
36
36
|
if document.has_link_reference():
|
|
37
37
|
link_references.append(self.__serialize_link_reference(document))
|
|
38
38
|
|
|
39
|
+
elif isinstance(document, dict):
|
|
40
|
+
# Validate that the dict contains KACLChanges objects (from version.sections())
|
|
41
|
+
if document and all(isinstance(v, KACLChanges) for v in document.values()):
|
|
42
|
+
data.extend([self.__serialize_sections(document), ""])
|
|
43
|
+
else:
|
|
44
|
+
raise TypeError(
|
|
45
|
+
"Dict input must contain KACLChanges objects (from version.sections())"
|
|
46
|
+
)
|
|
47
|
+
|
|
39
48
|
data.extend(link_references)
|
|
40
49
|
|
|
41
50
|
if data[-1] != "":
|
|
@@ -72,7 +81,17 @@ class KACLMarkdownSerializer:
|
|
|
72
81
|
|
|
73
82
|
def __serialize_version(self, obj):
|
|
74
83
|
lines = [self.__serialize_header(obj), ""]
|
|
75
|
-
|
|
84
|
+
lines.append(self.__serialize_sections(obj.sections()))
|
|
85
|
+
return "\n".join(lines).strip()
|
|
86
|
+
|
|
87
|
+
def __serialize_sections(self, sections_dict):
|
|
88
|
+
"""Serialize a dictionary of section title -> KACLChanges.
|
|
89
|
+
|
|
90
|
+
Used by both __serialize_version (for full version with header)
|
|
91
|
+
and for standalone sections (for --no-header output).
|
|
92
|
+
"""
|
|
93
|
+
lines = []
|
|
94
|
+
for title, changes in sections_dict.items():
|
|
76
95
|
lines.extend(
|
|
77
96
|
[
|
|
78
97
|
self.__serialize_header(changes),
|
|
@@ -81,7 +100,6 @@ class KACLMarkdownSerializer:
|
|
|
81
100
|
"",
|
|
82
101
|
]
|
|
83
102
|
)
|
|
84
|
-
|
|
85
103
|
return "\n".join(lines).strip()
|
|
86
104
|
|
|
87
105
|
def __serialize_list(self, obj):
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
kacl/__init__.py,sha256=
|
|
1
|
+
kacl/__init__.py,sha256=OmXywkfL0JxSqAAoG4DZ_BzNupOZLCJp-KHxeKCpahU,667
|
|
2
2
|
kacl/__main__.py,sha256=cpulIGoFUJNN5ZW9oUoNN1PnBvrOyJ24xwtpf_yRwgQ,91
|
|
3
3
|
kacl/changes.py,sha256=Speu1KLMNQVn0U2BMaO8ta4IEaQLTQtpW0IhN0JjGdY,704
|
|
4
4
|
kacl/config.py,sha256=c2QiP-BriJJwzrw36oigJWKe6t4o6yhmN_nPSL6bcRk,4242
|
|
5
|
-
kacl/document.py,sha256=
|
|
5
|
+
kacl/document.py,sha256=w0NxB06PeFS-EnN6YVLTVbQyT7ffn7swOigWmEmfq7c,31036
|
|
6
6
|
kacl/element.py,sha256=OG02QI8ND5fJpBMceT6dbIHr4uX9gLxK_fPCsOvMDHI,416
|
|
7
7
|
kacl/exception.py,sha256=MfOVpUvhcQtm10rSY__74-oLo445PG8mLFGJPPIfXH0,41
|
|
8
8
|
kacl/jira_client.py,sha256=KPE94bZDkJFKw3okFsCgf2DjoyMlUUTMZKtQGKreVQY,989
|
|
9
|
-
kacl/kacl_cli.py,sha256=
|
|
9
|
+
kacl/kacl_cli.py,sha256=WdAhN4seDw-myafYaBn83drH33kbztUhnNPxr4BSbWw,23980
|
|
10
10
|
kacl/link_provider.py,sha256=tgvMYhJe2ErH1m_qXMlQEacq9Cg_KGp_-sF03sVFP6E,1866
|
|
11
11
|
kacl/parser.py,sha256=EUtRjgaW0beWVqiYaRJ9Rcf6jbuGoTgWzVBdOdUHnv8,2587
|
|
12
|
-
kacl/serializer.py,sha256=
|
|
12
|
+
kacl/serializer.py,sha256=g5eFim8OpSbgyShyFANSwOEbAfJqCNUXaRJtPO79blc,3931
|
|
13
13
|
kacl/utils.py,sha256=4iWIJVNtv22v0IGXDjuEATPMQsJBr5Ycy9Q2zV2jkHE,2835
|
|
14
14
|
kacl/validation.py,sha256=b9r_5CyY6Cmi9BePh47IgZ3j64zdVsoB_fFvucieNbw,2125
|
|
15
15
|
kacl/version.py,sha256=IDYCWIIXzxdYyMptUAidMgf0SXJqoETFVJ8NVyKgA9A,9526
|
|
16
16
|
kacl/config/kacl-default.yml,sha256=cXHl_w04SW0HA7OyJMMuaC6DTeXlhI2Sfsx7lygTPf4,1513
|
|
17
|
-
python_kacl-0.7.
|
|
18
|
-
python_kacl-0.7.
|
|
19
|
-
python_kacl-0.7.
|
|
20
|
-
python_kacl-0.7.
|
|
21
|
-
python_kacl-0.7.
|
|
22
|
-
python_kacl-0.7.
|
|
17
|
+
python_kacl-0.7.3.dist-info/licenses/LICENSE,sha256=TRSJOIt7LZuMeZXFleJVL_LHczSxqi70HEiTLT-kI8Q,1075
|
|
18
|
+
python_kacl-0.7.3.dist-info/METADATA,sha256=6__BT5lJYFoJxk5bRXMCaBo4Oiybjvr3JoV_csc7Ynk,42453
|
|
19
|
+
python_kacl-0.7.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
20
|
+
python_kacl-0.7.3.dist-info/entry_points.txt,sha256=rXqqJKfm6Y7fYfioq_7ay2VWOOM9C-hts1IsoGTtojM,76
|
|
21
|
+
python_kacl-0.7.3.dist-info/top_level.txt,sha256=BcmQgo67JyGnVZ3Jc0Ag8hKMGVOqXc8ex01zW4Njw5M,5
|
|
22
|
+
python_kacl-0.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|