Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -194,12 +194,7 @@ def main():
|
|
| 194 |
phrases_checked = 0
|
| 195 |
total_paths_checked = 0
|
| 196 |
total_matches = 0
|
| 197 |
-
|
| 198 |
-
# β
Ek hi line par progress dikhane ke liye function
|
| 199 |
-
def update_progress(completed, total):
|
| 200 |
-
pct = (completed / total) * 100
|
| 201 |
-
sys.stdout.write(f"\rβ³ Scanning Progress: {pct:.1f}% ({completed}/{total})")
|
| 202 |
-
sys.stdout.flush()
|
| 203 |
|
| 204 |
print(f"π Starting {NUM_WORKERS} workers on your Dual-Socket Xeon...\n")
|
| 205 |
|
|
@@ -215,13 +210,17 @@ def main():
|
|
| 215 |
total_paths_checked += paths
|
| 216 |
|
| 217 |
for match in matches:
|
| 218 |
-
# β
|
| 219 |
print(f"\n{match}")
|
| 220 |
total_matches += 1
|
| 221 |
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
-
print()
|
| 225 |
|
| 226 |
except KeyboardInterrupt:
|
| 227 |
print("\n\nπ Script ruk gayi (Ctrl+C).")
|
|
@@ -230,7 +229,7 @@ def main():
|
|
| 230 |
|
| 231 |
global_elapsed = time.time() - global_start
|
| 232 |
|
| 233 |
-
print("
|
| 234 |
print("π RUN SUMMARY")
|
| 235 |
print("=" * 60)
|
| 236 |
print(f"π Phrases checked in THIS run: {phrases_checked}")
|
|
|
|
| 194 |
phrases_checked = 0
|
| 195 |
total_paths_checked = 0
|
| 196 |
total_matches = 0
|
| 197 |
+
last_percentage_printed = -1 # β
Track last printed percentage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
print(f"π Starting {NUM_WORKERS} workers on your Dual-Socket Xeon...\n")
|
| 200 |
|
|
|
|
| 210 |
total_paths_checked += paths
|
| 211 |
|
| 212 |
for match in matches:
|
| 213 |
+
# β
Nayi line banayein match ke liye
|
| 214 |
print(f"\n{match}")
|
| 215 |
total_matches += 1
|
| 216 |
|
| 217 |
+
# β
Sirf tab print karein jab percentage (integer) change ho
|
| 218 |
+
current_pct = int((phrases_checked / total_phrases) * 100)
|
| 219 |
+
if current_pct > last_percentage_printed:
|
| 220 |
+
print(f"\rβ³ Scanning Progress: {current_pct}% ({phrases_checked}/{total_phrases})", end="", flush=True)
|
| 221 |
+
last_percentage_printed = current_pct
|
| 222 |
|
| 223 |
+
print("\n") # New line after progress bar
|
| 224 |
|
| 225 |
except KeyboardInterrupt:
|
| 226 |
print("\n\nπ Script ruk gayi (Ctrl+C).")
|
|
|
|
| 229 |
|
| 230 |
global_elapsed = time.time() - global_start
|
| 231 |
|
| 232 |
+
print("=" * 60)
|
| 233 |
print("π RUN SUMMARY")
|
| 234 |
print("=" * 60)
|
| 235 |
print(f"π Phrases checked in THIS run: {phrases_checked}")
|