robotcode-plugin 2.6.2__tar.gz → 2.7.0__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: robotcode-plugin
3
- Version: 2.6.2
3
+ Version: 2.7.0
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
@@ -349,7 +349,7 @@ class Application:
349
349
  text = as_json(
350
350
  data,
351
351
  indent=format == OutputFormat.JSON_INDENT,
352
- compact=format == OutputFormat.TEXT,
352
+ compact=format == OutputFormat.JSON,
353
353
  )
354
354
  else:
355
355
  text = str(data)
@@ -0,0 +1 @@
1
+ __version__ = "2.7.0"
@@ -0,0 +1,26 @@
1
+ import click
2
+
3
+ # Set in the environment once a wrapper has been applied to the process tree.
4
+ # Prevents infinite re-exec recursion and lets an outer layer (e.g. the VS Code
5
+ # debug launcher applying its own wrapper) suppress the CLI/profile re-exec.
6
+ WRAPPER_APPLIED_ENV = "ROBOTCODE_WRAPPER_APPLIED"
7
+
8
+ _WRAPPABLE_ATTR = "__robotcode_wrappable__"
9
+
10
+
11
+ def wrappable(cmd: click.Command) -> click.Command:
12
+ """Mark a CLI command as *wrappable*.
13
+
14
+ When a `wrapper` (session) command is configured, a wrappable command is
15
+ re-executed through it, because it executes Robot Framework (and may, for
16
+ example, need to run inside a specific X11/Wayland session). Commands that
17
+ do not execute Robot Framework - language server, discovery, libdoc, … -
18
+ must NOT be marked.
19
+ """
20
+ setattr(cmd, _WRAPPABLE_ATTR, True)
21
+ return cmd
22
+
23
+
24
+ def is_wrappable(cmd: click.Command) -> bool:
25
+ """Return whether `cmd` was marked with :func:`wrappable`."""
26
+ return bool(getattr(cmd, _WRAPPABLE_ATTR, False))
@@ -1 +0,0 @@
1
- __version__ = "2.6.2"