robotcode-plugin 2.9.0.dev124__py3-none-any.whl → 2.9.0.dev180__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.
@@ -373,6 +373,7 @@ class Application:
373
373
  data,
374
374
  indent=format == OutputFormat.JSON_INDENT,
375
375
  compact=format == OutputFormat.JSON,
376
+ ensure_ascii=True,
376
377
  )
377
378
  else:
378
379
  text = str(data)
@@ -452,8 +453,14 @@ class Application:
452
453
 
453
454
  from rich.console import Console
454
455
 
455
- markdown = _get_deep_markdown_cls()(text, justify="left", code_theme="default")
456
456
  console = Console()
457
+ # rich draws bullets and quote bars that a stream which isn't UTF can't encode,
458
+ # such as a pipe on Windows, so the raw markdown goes there instead.
459
+ if not console.encoding.lower().startswith("utf"):
460
+ self.echo_via_pager(text)
461
+ return
462
+
463
+ markdown = _get_deep_markdown_cls()(text, justify="left", code_theme="default")
457
464
 
458
465
  def _measure() -> int:
459
466
  measure = Console(width=console.size.width, record=False, soft_wrap=True)
@@ -1 +1 @@
1
- __version__ = "2.9.0-dev.124"
1
+ __version__ = "2.9.0-dev.180"
@@ -1,5 +1,9 @@
1
+ from typing import TypeVar
2
+
1
3
  import click
2
4
 
5
+ _C = TypeVar("_C", bound=click.Command)
6
+
3
7
  _ROBOT_EXIT_CODES_ATTR = "__robotcode_robot_exit_codes__"
4
8
 
5
9
 
@@ -19,3 +23,23 @@ def robot_exit_codes(cmd: click.Command) -> click.Command:
19
23
  def has_robot_exit_codes(cmd: click.Command) -> bool:
20
24
  """Return whether `cmd` was marked with :func:`robot_exit_codes`."""
21
25
  return bool(getattr(cmd, _ROBOT_EXIT_CODES_ATTR, False))
26
+
27
+
28
+ _ERRORS_EXIT_WITH_128_ATTR = "__robotcode_errors_exit_with_128__"
29
+
30
+
31
+ def errors_exit_with_128(cmd: _C) -> _C:
32
+ """Mark a CLI command whose errors exit with 128.
33
+
34
+ Such a command uses its lower exit codes for what it found, as `results diff`
35
+ does with `--exit-code`, so every error that stops it - Click's 1 or 2, or an
36
+ unexpected exception - exits with 128 instead, which no finding uses. Marking
37
+ a group covers its subcommands.
38
+ """
39
+ setattr(cmd, _ERRORS_EXIT_WITH_128_ATTR, True)
40
+ return cmd
41
+
42
+
43
+ def has_errors_exit_with_128(cmd: click.Command) -> bool:
44
+ """Return whether `cmd` was marked with :func:`errors_exit_with_128`."""
45
+ return bool(getattr(cmd, _ERRORS_EXIT_WITH_128_ATTR, False))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: robotcode-plugin
3
- Version: 2.9.0-dev.124
3
+ Version: 2.9.0-dev.180
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
@@ -1,14 +1,14 @@
1
- robotcode/plugin/__init__.py,sha256=h6lXt0W8_c72vw6M4GY_0pFEZuBbFSvf6ZPAoCK5n00,18546
2
- robotcode/plugin/__version__.py,sha256=kB2HCucrVBrLij9hB2UXa9rwCOmEfmeDk12kUWayuAU,30
1
+ robotcode/plugin/__init__.py,sha256=ERyHVGOMi4Sulwc6F99fw2zUUZMEVuwqFR1Vvsv7TJE,18867
2
+ robotcode/plugin/__version__.py,sha256=39yWLbn8Xd-rhIKA3f_deOqSMNKc9u8vdFKv8xFpYNk,30
3
3
  robotcode/plugin/_agent_detection.py,sha256=PVsBAxy_Xn_uefTBpBAGE-q3Z5CUxbhwp_z4Dcb_RL4,3606
4
4
  robotcode/plugin/manager.py,sha256=ARNXtSbQTRktsbNQGLeU1fwtsK7GdstHa6OJaXuadrU,1098
5
5
  robotcode/plugin/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
6
6
  robotcode/plugin/specs.py,sha256=_Ws6A9CZoCTHdxx_5D8ifpj4tfwin4zYUYJ8WLhSO3U,588
7
7
  robotcode/plugin/click_helper/aliases.py,sha256=NJZKyF6GOro52fjp728OZfqZ9EptNhiJvQBhunqIpzc,1628
8
- robotcode/plugin/click_helper/exit_codes.py,sha256=k5ih_20gKkuEWpOhyig2_g11ZywrjPoiZHzH9pV2obs,854
8
+ robotcode/plugin/click_helper/exit_codes.py,sha256=LhuSv1IDfrgIZGaB81cnVw7aIarUbXH0aea4CJtP-ho,1647
9
9
  robotcode/plugin/click_helper/options.py,sha256=eAU05TfOq93wVWkiYqw7BV6RrXAp1xw9jT6DsPRdZ_Y,11430
10
10
  robotcode/plugin/click_helper/types.py,sha256=UAno_G-0uNdPfapGCvECwd0yghdEZXMMv4DIlUAKKsw,3679
11
11
  robotcode/plugin/click_helper/wrappable.py,sha256=dYC6hYvtPRnjDzC-k7fiIsgoLRnwS-ACLWf0COnMPl4,5009
12
- robotcode_plugin-2.9.0.dev124.dist-info/METADATA,sha256=CY8Q6hoo0T2_Qn0JcQGXnRbq7x9kZadZqlgwk6iVM9g,2844
13
- robotcode_plugin-2.9.0.dev124.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
14
- robotcode_plugin-2.9.0.dev124.dist-info/RECORD,,
12
+ robotcode_plugin-2.9.0.dev180.dist-info/METADATA,sha256=DRbdpMqmBFLyywpsgVgm-HCid77VRXd55S4Q2GpllKs,2844
13
+ robotcode_plugin-2.9.0.dev180.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
14
+ robotcode_plugin-2.9.0.dev180.dist-info/RECORD,,