batch24-28 1.2.2__tar.gz → 1.2.3__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.2 → batch24_28-1.2.3}/PKG-INFO +15 -2
- {batch24_28-1.2.2 → batch24_28-1.2.3}/README.md +14 -1
- {batch24_28-1.2.2 → batch24_28-1.2.3}/pyproject.toml +1 -1
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/__init__.py +3 -2
- batch24_28-1.2.3/src/batch24_28/reporter.py +18 -0
- batch24_28-1.2.3/src/batch24_28/watcher.py +40 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28.egg-info/PKG-INFO +15 -2
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28.egg-info/SOURCES.txt +1 -0
- batch24_28-1.2.2/src/batch24_28/watcher.py +0 -24
- {batch24_28-1.2.2 → batch24_28-1.2.3}/setup.cfg +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/art.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/calculator.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/chess_game.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/from .py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/games.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/monitor.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28/timers.py +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28.egg-info/dependency_links.txt +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/src/batch24_28.egg-info/requires.txt +0 -0
- {batch24_28-1.2.2 → batch24_28-1.2.3}/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.3
|
|
4
4
|
Summary: A multi featured Python terminal
|
|
5
5
|
Requires-Python: >=3.7
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -122,7 +122,20 @@ monitor_performance(threshold=80)
|
|
|
122
122
|
|
|
123
123
|
---
|
|
124
124
|
|
|
125
|
-
### 8. System
|
|
125
|
+
### 8. System Information Reporter
|
|
126
|
+
|
|
127
|
+
Generates a comprehensive snapshot of system hardware and environment status.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from batch24_28 import generate_system_report
|
|
131
|
+
|
|
132
|
+
# Generate report to a file
|
|
133
|
+
generate_system_report("system_report.txt")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### 9. System Performance Sentinel
|
|
126
139
|
|
|
127
140
|
Monitor a directory for file system changes (created, modified, or deleted).
|
|
128
141
|
|
|
@@ -113,7 +113,20 @@ monitor_performance(threshold=80)
|
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
116
|
-
### 8. System
|
|
116
|
+
### 8. System Information Reporter
|
|
117
|
+
|
|
118
|
+
Generates a comprehensive snapshot of system hardware and environment status.
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from batch24_28 import generate_system_report
|
|
122
|
+
|
|
123
|
+
# Generate report to a file
|
|
124
|
+
generate_system_report("system_report.txt")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### 9. System Performance Sentinel
|
|
117
130
|
|
|
118
131
|
Monitor a directory for file system changes (created, modified, or deleted).
|
|
119
132
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.3"
|
|
2
2
|
|
|
3
3
|
from .timers import start_countdown, start_stopwatch, run_interactive_timer
|
|
4
4
|
from .art import print_hello
|
|
@@ -6,4 +6,5 @@ from .calculator import AdvancedCalculator
|
|
|
6
6
|
from .games import RockPaperScissors
|
|
7
7
|
from .chess_game import TerminalChess
|
|
8
8
|
from .watcher import start_file_watcher
|
|
9
|
-
from .monitor import monitor_performance
|
|
9
|
+
from .monitor import monitor_performance
|
|
10
|
+
from .reporter import generate_system_report
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import platform
|
|
2
|
+
import psutil
|
|
3
|
+
import datetime
|
|
4
|
+
|
|
5
|
+
def generate_system_report(filename="system_report.txt"):
|
|
6
|
+
"""Generates a text report of the current system status."""
|
|
7
|
+
report = [
|
|
8
|
+
f"--- System Report ({datetime.datetime.now()}) ---",
|
|
9
|
+
f"OS: {platform.system()} {platform.release()}",
|
|
10
|
+
f"Processor: {platform.processor()}",
|
|
11
|
+
f"RAM: {round(psutil.virtual_memory().total / (1024**3), 2)} GB",
|
|
12
|
+
f"CPU Usage: {psutil.cpu_percent(interval=1)}%",
|
|
13
|
+
f"Disk Usage: {psutil.disk_usage('/').percent}%"
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
with open(filename, "w") as f:
|
|
17
|
+
f.write("\n".join(report))
|
|
18
|
+
print(f"[*] Report saved to {filename}")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
from tkinter import filedialog
|
|
3
|
+
import shutil
|
|
4
|
+
import os
|
|
5
|
+
import time
|
|
6
|
+
from watchdog.observers import Observer
|
|
7
|
+
from watchdog.events import FileSystemEventHandler
|
|
8
|
+
|
|
9
|
+
def choose_save_location(original_filename):
|
|
10
|
+
root = tk.Tk()
|
|
11
|
+
root.withdraw()
|
|
12
|
+
file_path = filedialog.asksaveasfilename(
|
|
13
|
+
defaultextension=".txt",
|
|
14
|
+
initialfile=original_filename,
|
|
15
|
+
title="Select where to save the backup"
|
|
16
|
+
)
|
|
17
|
+
root.destroy()
|
|
18
|
+
return file_path
|
|
19
|
+
|
|
20
|
+
class ChangeHandler(FileSystemEventHandler):
|
|
21
|
+
def on_modified(self, event):
|
|
22
|
+
if not event.is_directory:
|
|
23
|
+
print(f"[!] Change detected: {event.src_path}")
|
|
24
|
+
target_path = choose_save_location(os.path.basename(event.src_path))
|
|
25
|
+
if target_path:
|
|
26
|
+
shutil.copy2(event.src_path, target_path)
|
|
27
|
+
print(f"[*] File saved to: {target_path}")
|
|
28
|
+
|
|
29
|
+
def start_file_watcher(path="."):
|
|
30
|
+
event_handler = ChangeHandler()
|
|
31
|
+
observer = Observer()
|
|
32
|
+
observer.schedule(event_handler, path, recursive=False)
|
|
33
|
+
observer.start()
|
|
34
|
+
print(f"[*] Watching directory: {path}")
|
|
35
|
+
try:
|
|
36
|
+
while True:
|
|
37
|
+
time.sleep(1)
|
|
38
|
+
except KeyboardInterrupt:
|
|
39
|
+
observer.stop()
|
|
40
|
+
observer.join()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batch24-28
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: A multi featured Python terminal
|
|
5
5
|
Requires-Python: >=3.7
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -122,7 +122,20 @@ monitor_performance(threshold=80)
|
|
|
122
122
|
|
|
123
123
|
---
|
|
124
124
|
|
|
125
|
-
### 8. System
|
|
125
|
+
### 8. System Information Reporter
|
|
126
|
+
|
|
127
|
+
Generates a comprehensive snapshot of system hardware and environment status.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from batch24_28 import generate_system_report
|
|
131
|
+
|
|
132
|
+
# Generate report to a file
|
|
133
|
+
generate_system_report("system_report.txt")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### 9. System Performance Sentinel
|
|
126
139
|
|
|
127
140
|
Monitor a directory for file system changes (created, modified, or deleted).
|
|
128
141
|
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from watchdog.observers import Observer
|
|
3
|
-
from watchdog.events import FileSystemEventHandler
|
|
4
|
-
|
|
5
|
-
class ChangeHandler(FileSystemEventHandler):
|
|
6
|
-
def on_modified(self, event):
|
|
7
|
-
if not event.is_directory:
|
|
8
|
-
print(f"\n[!] Change detected: {event.src_path}")
|
|
9
|
-
# Add your custom logic here (e.g., auto-backup, alert, etc.)
|
|
10
|
-
|
|
11
|
-
def start_file_watcher(path="."):
|
|
12
|
-
"""Starts a watcher that monitors a directory for changes."""
|
|
13
|
-
print(f"[*] Watching directory: {path}")
|
|
14
|
-
event_handler = ChangeHandler()
|
|
15
|
-
observer = Observer()
|
|
16
|
-
observer.schedule(event_handler, path, recursive=False)
|
|
17
|
-
observer.start()
|
|
18
|
-
try:
|
|
19
|
-
while True:
|
|
20
|
-
time.sleep(1)
|
|
21
|
-
except KeyboardInterrupt:
|
|
22
|
-
observer.stop()
|
|
23
|
-
print("\n[*] Watcher stopped.")
|
|
24
|
-
observer.join()
|
|
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
|
|
File without changes
|