-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
76 lines (61 loc) · 2.36 KB
/
Copy pathutils.py
File metadata and controls
76 lines (61 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""
Utility functions for Liquidity Risk Intelligence Platform
Provides terminal styling, screen management, and system helpers
"""
import os
from datetime import datetime
def clear_screen():
"""Clear terminal screen for cleaner output
This function clears the terminal screen to provide a clean slate for
each phase of the analysis. It's standard practice to keep
the terminal output focused on current operations.
Uses OS-specific command:
- 'cls' for Windows (os.name == 'nt')
- 'clear' for Unix/Linux/Mac
"""
os.system('cls' if os.name == 'nt' else 'clear')
def color_text(text, color):
"""Add color to terminal output
Implements Terminal's signature color scheme:
- RED: Critical alerts (risk ≥ 85%)
- AMBER/YELLOW: Warning alerts (risk ≥ 70%)
- GREEN: Normal conditions
Uses ANSI escape codes for terminal coloring:
- \033[91m = bright red
- \033[92m = bright green
- \033[93m = bright yellow
- \033[0m = reset to default
Args:
text (str): Text to colorize
color (str): Color name ('red', 'green', 'yellow', etc.)
Returns:
str: Colorized text ready for terminal output
"""
colors = {
'red': '\033[91m', # Alert Red
'green': '\033[92m', # Status Green
'yellow': '\033[93m', # Warning Orange
'blue': '\033[94m',
'purple': '\033[95m',
'cyan': '\033[96m',
'white': '\033[97m',
'end': '\033[0m' # Reset to default color
}
return f"{colors.get(color, '')}{text}{colors['end']}"
def print_banner():
"""Print banner with warning message
Creates the distinctive Terminal look with:
- Yellow header bar
- Clear system identification
- Warning message about demo nature
This mimics stanadrd terminal startup screen which always
identifies the system and includes disclaimers.
"""
from utils import clear_screen, color_text
clear_screen()
print(color_text("="*60, 'yellow'))
print(color_text("LIQUIDITY RISK INTELLIGENCE PLATFORM", 'yellow'))
print(color_text("="*60, 'yellow'))
print(color_text("Real-time liquidity crisis detection system\n", 'white'))
print(color_text("⚠️ WARNING: THIS IS A DEMONSTRATION SYSTEM", 'red'))
print(color_text(" Not for actual trading decisions\n", 'white'))