batch24-28 1.2.1__tar.gz → 1.2.2__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.
- {batch24_28-1.2.1 → batch24_28-1.2.2}/PKG-INFO +17 -5
- {batch24_28-1.2.1 → batch24_28-1.2.2}/README.md +16 -4
- {batch24_28-1.2.1 → batch24_28-1.2.2}/pyproject.toml +1 -1
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/__init__.py +3 -3
- batch24_28-1.2.2/src/batch24_28/from .py +1 -0
- batch24_28-1.2.2/src/batch24_28/monitor.py +17 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28.egg-info/PKG-INFO +17 -5
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28.egg-info/SOURCES.txt +1 -0
- batch24_28-1.2.1/src/batch24_28/monitor.py +0 -16
- {batch24_28-1.2.1 → batch24_28-1.2.2}/setup.cfg +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/art.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/calculator.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/chess_game.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/games.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/timers.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28/watcher.py +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28.egg-info/dependency_links.txt +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28.egg-info/requires.txt +0 -0
- {batch24_28-1.2.1 → batch24_28-1.2.2}/src/batch24_28.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batch24-28
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: A multi featured Python terminal
|
|
5
5
|
Requires-Python: >=3.7
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -109,14 +109,26 @@ start_system_monitor()
|
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
112
|
-
### 7.
|
|
112
|
+
### 7. System Performance Sentinel
|
|
113
113
|
|
|
114
|
-
Monitor
|
|
114
|
+
Monitor your CPU usage and receive real-time alerts when it exceeds a set threshold.
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from batch24_28 import monitor_performance
|
|
118
|
+
|
|
119
|
+
# Monitor for CPU usage > 80%
|
|
120
|
+
monitor_performance(threshold=80)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 8. System Performance Sentinel
|
|
126
|
+
|
|
127
|
+
Monitor a directory for file system changes (created, modified, or deleted).
|
|
115
128
|
|
|
116
129
|
```python
|
|
117
130
|
from batch24_28 import start_file_watcher
|
|
118
131
|
|
|
119
|
-
#
|
|
120
|
-
# Press Ctrl + C to stop the watcher
|
|
132
|
+
# Watch the current directory
|
|
121
133
|
start_file_watcher(path=".")
|
|
122
134
|
```
|
|
@@ -100,14 +100,26 @@ start_system_monitor()
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
### 7.
|
|
103
|
+
### 7. System Performance Sentinel
|
|
104
104
|
|
|
105
|
-
Monitor
|
|
105
|
+
Monitor your CPU usage and receive real-time alerts when it exceeds a set threshold.
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from batch24_28 import monitor_performance
|
|
109
|
+
|
|
110
|
+
# Monitor for CPU usage > 80%
|
|
111
|
+
monitor_performance(threshold=80)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### 8. System Performance Sentinel
|
|
117
|
+
|
|
118
|
+
Monitor a directory for file system changes (created, modified, or deleted).
|
|
106
119
|
|
|
107
120
|
```python
|
|
108
121
|
from batch24_28 import start_file_watcher
|
|
109
122
|
|
|
110
|
-
#
|
|
111
|
-
# Press Ctrl + C to stop the watcher
|
|
123
|
+
# Watch the current directory
|
|
112
124
|
start_file_watcher(path=".")
|
|
113
125
|
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.2"
|
|
2
2
|
|
|
3
3
|
from .timers import start_countdown, start_stopwatch, run_interactive_timer
|
|
4
4
|
from .art import print_hello
|
|
5
5
|
from .calculator import AdvancedCalculator
|
|
6
6
|
from .games import RockPaperScissors
|
|
7
7
|
from .chess_game import TerminalChess
|
|
8
|
-
from .
|
|
9
|
-
from .
|
|
8
|
+
from .watcher import start_file_watcher
|
|
9
|
+
from .monitor import monitor_performance
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .calculator import AdvancedCalculator
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import psutil
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
def monitor_performance(threshold=90):
|
|
5
|
+
"""
|
|
6
|
+
Monitors CPU usage and alerts if it exceeds the threshold.
|
|
7
|
+
"""
|
|
8
|
+
print(f"[*] Performance Sentinel active. Monitoring for CPU usage > {threshold}%")
|
|
9
|
+
try:
|
|
10
|
+
while True:
|
|
11
|
+
# interval=1 means it checks over a 1-second period
|
|
12
|
+
cpu_usage = psutil.cpu_percent(interval=1)
|
|
13
|
+
if cpu_usage > threshold:
|
|
14
|
+
print(f"[!] WARNING: High CPU usage detected: {cpu_usage}%")
|
|
15
|
+
time.sleep(1)
|
|
16
|
+
except KeyboardInterrupt:
|
|
17
|
+
print("\n[*] Sentinel stopped.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batch24-28
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: A multi featured Python terminal
|
|
5
5
|
Requires-Python: >=3.7
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -109,14 +109,26 @@ start_system_monitor()
|
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
112
|
-
### 7.
|
|
112
|
+
### 7. System Performance Sentinel
|
|
113
113
|
|
|
114
|
-
Monitor
|
|
114
|
+
Monitor your CPU usage and receive real-time alerts when it exceeds a set threshold.
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from batch24_28 import monitor_performance
|
|
118
|
+
|
|
119
|
+
# Monitor for CPU usage > 80%
|
|
120
|
+
monitor_performance(threshold=80)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 8. System Performance Sentinel
|
|
126
|
+
|
|
127
|
+
Monitor a directory for file system changes (created, modified, or deleted).
|
|
115
128
|
|
|
116
129
|
```python
|
|
117
130
|
from batch24_28 import start_file_watcher
|
|
118
131
|
|
|
119
|
-
#
|
|
120
|
-
# Press Ctrl + C to stop the watcher
|
|
132
|
+
# Watch the current directory
|
|
121
133
|
start_file_watcher(path=".")
|
|
122
134
|
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import psutil
|
|
2
|
-
import time
|
|
3
|
-
|
|
4
|
-
def start_system_monitor():
|
|
5
|
-
"""Displays real-time CPU and Memory usage in the terminal."""
|
|
6
|
-
print("Starting System Monitor (Press Ctrl+C to stop)...")
|
|
7
|
-
try:
|
|
8
|
-
while True:
|
|
9
|
-
# Fetch usage percentages
|
|
10
|
-
cpu = psutil.cpu_percent(interval=1)
|
|
11
|
-
memory = psutil.virtual_memory().percent
|
|
12
|
-
|
|
13
|
-
# Print using \r to overwrite the line, keeping the terminal clean
|
|
14
|
-
print(f"\rCPU Usage: {cpu}% | Memory Usage: {memory}%", end="", flush=True)
|
|
15
|
-
except KeyboardInterrupt:
|
|
16
|
-
print("\nMonitoring stopped.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|