Coverage for src/jobs/outputs.py: 100.00%
20 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-10-18 15:02 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-10-18 15:02 +0000
1#!/usr/bin/env python3
3# Components
4from ..prints.colors import Colors
5from ..system.platform import Platform
7# Outputs class
8class Outputs:
10 # Debugging
11 @staticmethod
12 def debugging(
13 container_exec: str,
14 container_name: str,
15 shell: str,
16 console: bool,
17 ) -> None:
19 # Debugging informations
20 print(' ')
21 print(
22 f' {Colors.YELLOW}{Colors.ARROW} INFORMATION: {Colors.BOLD}' \
23 f'Job execution held active for debugging purposes{Colors.RESET}'
24 )
25 print(
26 f' {Colors.BOLD}' \
27 f"Use '{Colors.CYAN}{container_exec} {container_name} {shell}" \
28 f'{Colors.BOLD}\' to debug manually{Colors.RESET}'
29 )
31 # Console informations
32 if console:
33 print(
34 f' {Colors.BOLD}' \
35 f'Launching console in container, ' \
36 f'use \'{Colors.CYAN}exit{Colors.BOLD}\' to interrupt...{Colors.RESET}'
37 )
39 # Interruption informations
40 else:
41 print(
42 f' {Colors.BOLD}' \
43 f'Interrupt job execution with Ctrl+C...{Colors.RESET}'
44 )
46 # Footer
47 print(' ')
48 Platform.flush()
50 # Interruption
51 @staticmethod
52 def interruption() -> None:
54 # Interruption output
55 print(' ')
56 print(' ')
57 print(
58 f' {Colors.YELLOW}{Colors.ARROW} WARNING: {Colors.BOLD}' \
59 f'User interruption detected, stopping the container...{Colors.RESET}'
60 )
61 print(' ')
62 Platform.flush()
64 # Warning
65 @staticmethod
66 def warning(message: str) -> None: # pragma: no cover
68 # Warning output
69 print(
70 f' {Colors.YELLOW}{Colors.ARROW} WARNING: {Colors.BOLD}{message}{Colors.RESET}'
71 )
72 print(' ')
73 Platform.flush()