robotcode-plugin 2.7.0__tar.gz → 2.8.0.dev548__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.
@@ -279,6 +279,9 @@ dist
279
279
  # vuepress build output
280
280
  .vuepress/dist
281
281
 
282
+ # Astro (documentation site)
283
+ docs/.astro/
284
+
282
285
  # Serverless directories
283
286
  .serverless/
284
287
 
@@ -339,7 +342,7 @@ bundled/libs
339
342
  # .agents
340
343
  .agents/
341
344
  skills-lock.json
342
- .claude
345
+ #.claude
343
346
 
344
347
  # sarif files
345
348
  /**/*.sarif.json
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: robotcode-plugin
3
- Version: 2.7.0
3
+ Version: 2.8.0-dev.548
4
4
  Summary: Some classes for RobotCode plugin management
5
5
  Project-URL: Donate, https://opencollective.com/robotcode
6
6
  Project-URL: Documentation, https://github.com/robotcodedev/robotcode#readme
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Programming Language :: Python :: 3.15
22
23
  Classifier: Programming Language :: Python :: Implementation :: CPython
23
24
  Classifier: Programming Language :: Python :: Implementation :: PyPy
24
25
  Classifier: Topic :: Utilities
@@ -18,6 +18,7 @@ classifiers = [
18
18
  "Programming Language :: Python :: 3.12",
19
19
  "Programming Language :: Python :: 3.13",
20
20
  "Programming Language :: Python :: 3.14",
21
+ "Programming Language :: Python :: 3.15",
21
22
  "Programming Language :: Python :: Implementation :: CPython",
22
23
  "Programming Language :: Python :: Implementation :: PyPy",
23
24
  "Operating System :: OS Independent",
@@ -136,6 +136,7 @@ def _get_deep_markdown_cls() -> "type[Markdown]":
136
136
  TableHeaderElement,
137
137
  TableRowElement,
138
138
  )
139
+ from rich.segment import Segment
139
140
  from rich.text import Text
140
141
 
141
142
  class LeftHeading(Heading):
@@ -196,6 +197,25 @@ def _get_deep_markdown_cls() -> "type[Markdown]":
196
197
  parser.options.maxNesting = 1000
197
198
  self.parsed = parser.parse(markup)
198
199
 
200
+ def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderResult:
201
+ # rich pads every line with spaces to the full console width. A
202
+ # pager that reserves columns (bat's line numbers and grid) wraps
203
+ # those full-width lines, and every wrapped remainder shows up
204
+ # as an empty line. Drop the padding unless it carries a
205
+ # background colour (code blocks draw a box with it).
206
+ for line in Segment.split_lines(cast(Iterable[Segment], super().__rich_console__(console, options))):
207
+ while line and not line[-1].control:
208
+ text, style, _ = line[-1]
209
+ if style is not None and style.bgcolor is not None:
210
+ break
211
+ text = text.rstrip(" ")
212
+ if text:
213
+ line[-1] = Segment(text, style)
214
+ break
215
+ line.pop()
216
+ yield from line
217
+ yield Segment.line()
218
+
199
219
  _deep_markdown_cls = DeepMarkdown
200
220
  return DeepMarkdown
201
221
 
@@ -341,7 +361,7 @@ class Application:
341
361
  if dataclasses.is_dataclass(data)
342
362
  else data
343
363
  if isinstance(data, dict)
344
- else {data: data}
364
+ else {"data": data}
345
365
  )
346
366
 
347
367
  if text is None:
@@ -0,0 +1 @@
1
+ __version__ = "2.8.0-dev.548"
@@ -0,0 +1,21 @@
1
+ import click
2
+
3
+ _ROBOT_EXIT_CODES_ATTR = "__robotcode_robot_exit_codes__"
4
+
5
+
6
+ def robot_exit_codes(cmd: click.Command) -> click.Command:
7
+ """Mark a CLI command that passes on the exit code of a Robot Framework tool.
8
+
9
+ Such a command answers with Robot Framework's exit codes, like the `wrappable`
10
+ commands that run Robot Framework, so an error robotcode reports itself for it
11
+ exits with Robot Framework's 252 instead of Click's 1 or 2. Mark the commands
12
+ that pass on a tool's exit code without running tests - rebot, libdoc,
13
+ testdoc; `wrappable` commands are covered already.
14
+ """
15
+ setattr(cmd, _ROBOT_EXIT_CODES_ATTR, True)
16
+ return cmd
17
+
18
+
19
+ def has_robot_exit_codes(cmd: click.Command) -> bool:
20
+ """Return whether `cmd` was marked with :func:`robot_exit_codes`."""
21
+ return bool(getattr(cmd, _ROBOT_EXIT_CODES_ATTR, False))
@@ -1 +0,0 @@
1
- __version__ = "2.7.0"