Skip to content

Commit ab845c3

Browse files
committed
Fix coderabbit comments
1 parent ec964d1 commit ab845c3

3 files changed

Lines changed: 12 additions & 19 deletions

File tree

doc/_ext/sphinxcontrib_asciinema.patch

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/asciinema.py b/asciinema.py
2-
index 8644220..849a3b9 100644
2+
index 8644220..44dad26 100644
33
--- a/asciinema.py
44
+++ b/asciinema.py
55
@@ -2,20 +2,20 @@ import os
@@ -36,7 +36,8 @@ index 8644220..849a3b9 100644
3636
+ "autoplay": "autoPlay",
3737
+ "idle-time-limit": "idleTimeLimit",
3838
"terminalfontsize": "terminalFontSize",
39-
"terminallineheigth": "terminalLineHeigth",
39+
- "terminallineheigth": "terminalLineHeigth",
40+
+ "terminallineheight": "terminalLineHeight",
4041
"terminalfontfamily": "terminalFontFamily",
4142
"audiourl": "audioUrl",
4243
}
@@ -104,11 +105,12 @@ index 8644220..849a3b9 100644
104105
raise nodes.SkipNode
105106

106107

107-
@@ -73,15 +91,34 @@ def depart(self, node):
108+
@@ -73,15 +91,35 @@ def depart(self, node):
108109
pass
109110

110111

111112
+def bool_parse(argument):
113+
+ """Parse the option as boolean."""
112114
+ if argument is None:
113115
+ raise ValueError("Boolean option must have a value")
114116
+
@@ -142,7 +144,7 @@ index 8644220..849a3b9 100644
142144
"start-at": directives.unchanged,
143145
"speed": directives.unchanged,
144146
"idle-time-limit": directives.unchanged,
145-
@@ -90,7 +127,7 @@ class ASCIINemaDirective(SphinxDirective):
147+
@@ -90,7 +128,7 @@ class ASCIINemaDirective(SphinxDirective):
146148
"fit": directives.unchanged,
147149
"controls": directives.unchanged,
148150
"markers": directives.unchanged,
@@ -151,7 +153,7 @@ index 8644220..849a3b9 100644
151153
"terminalfontsize": directives.unchanged,
152154
"terminalfontfamily": directives.unchanged,
153155
"terminallineheight": directives.unchanged,
154-
@@ -102,25 +139,30 @@ class ASCIINemaDirective(SphinxDirective):
156+
@@ -102,25 +140,25 @@ class ASCIINemaDirective(SphinxDirective):
155157

156158
def run(self):
157159
arg = self.arguments[0]
@@ -163,11 +165,6 @@ index 8644220..849a3b9 100644
163165
- if path and not path.endswith('/'):
164166
- path += '/'
165167
- fname = arg if arg.startswith('./') else path + arg
166-
+
167-
+ if self.option_spec:
168-
+ for option, value in options.items():
169-
+ self.option_spec[option](value)
170-
+
171168
+ kw = {"options": options}
172169
+ path = options.get("path", "")
173170
+ if path and not path.endswith("/"):
@@ -198,7 +195,7 @@ index 8644220..849a3b9 100644
198195
return [Asciinema(**kw)]
199196

200197
def is_file(self, rel_file):
201-
@@ -129,17 +171,18 @@ class ASCIINemaDirective(SphinxDirective):
198+
@@ -129,17 +167,18 @@ class ASCIINemaDirective(SphinxDirective):
202199

203200
def to_b64(self, filename):
204201
import base64

doc/_ext/sphinxcontrib_asciinema/.dfetch_data.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# For more info see https://dfetch.rtfd.io/en/latest/getting_started.html
33
dfetch:
44
branch: master
5-
hash: 0dd25605d7cf4f6d35bed54fbb3fe4b4
6-
last_fetch: 21/12/2025, 11:45:03
5+
hash: c26afa0279fa96392fd7f46d516060a4
6+
last_fetch: 21/12/2025, 13:39:42
77
patch: doc/_ext/sphinxcontrib_asciinema.patch
88
remote_url: https://github.com/divi255/sphinxcontrib.asciinema.git
99
revision: 5ee0c5be62236a5dee0032e1d8dd59957a0c1d4c

doc/_ext/sphinxcontrib_asciinema/asciinema.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def visit_html(self, node):
2727
"autoplay": "autoPlay",
2828
"idle-time-limit": "idleTimeLimit",
2929
"terminalfontsize": "terminalFontSize",
30-
"terminallineheigth": "terminalLineHeigth",
30+
"terminallineheight": "terminalLineHeight",
3131
"terminalfontfamily": "terminalFontFamily",
3232
"audiourl": "audioUrl",
3333
}
@@ -92,6 +92,7 @@ def depart(self, node):
9292

9393

9494
def bool_parse(argument):
95+
"""Parse the option as boolean."""
9596
if argument is None:
9697
raise ValueError("Boolean option must have a value")
9798

@@ -141,11 +142,6 @@ def run(self):
141142
arg = self.arguments[0]
142143
options = dict(self.env.config["sphinxcontrib_asciinema_defaults"])
143144
options.update(self.options)
144-
145-
if self.option_spec:
146-
for option, value in options.items():
147-
self.option_spec[option](value)
148-
149145
kw = {"options": options}
150146
path = options.get("path", "")
151147
if path and not path.endswith("/"):

0 commit comments

Comments
 (0)