DILSHAD737 commited on
Commit
ebc808b
Β·
verified Β·
1 Parent(s): 819f94f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
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
- # βœ… Match print karne se pehle nayi line banayein
219
  print(f"\n{match}")
220
  total_matches += 1
221
 
222
- update_progress(phrases_checked, total_phrases)
 
 
 
 
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("\n" + "=" * 60)
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}")