medicafe 0.250806.0__py3-none-any.whl → 0.250806.3__py3-none-any.whl

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.

Potentially problematic release.


This version of medicafe might be problematic. Click here for more details.

MediBot/MediBot.bat CHANGED
@@ -307,14 +307,17 @@ if "!internet_available!"=="1" (
307
307
  )
308
308
  echo 6. Run MediBot
309
309
  echo.
310
- echo 7. Open Log File
310
+ echo 7. Troubleshooting: Open Log File
311
311
  echo.
312
- echo 8. Exit
312
+ echo 8. Troubleshooting: Clear Python Cache
313
+ echo.
314
+ echo 9. Exit
313
315
  echo.
314
316
  set /p choice=Enter your choice:
315
317
 
316
318
  :: Update option numbers
317
- if "!choice!"=="8" goto end_script
319
+ if "!choice!"=="9" goto end_script
320
+ if "!choice!"=="8" goto clear_cache
318
321
  if "!choice!"=="7" goto open_latest_log
319
322
  if "!choice!"=="6" goto medibot_flow
320
323
  if "!choice!"=="5" goto united_deductible
@@ -520,6 +523,38 @@ py "%python_script%" "%config_file%" "!new_csv_path!"
520
523
  echo CSV Processor Complete...
521
524
  goto :eof
522
525
 
526
+ :: Clear Python Cache
527
+ :clear_cache
528
+ cls
529
+ echo Clearing Python cache for MediCafe...
530
+ echo.
531
+ cd /d "%~dp0.."
532
+
533
+ :: Check if update_medicafe.py exists in the moved location first
534
+ if exist "F:\Medibot\update_medicafe.py" (
535
+ echo Found update_medicafe.py in F:\Medibot\ - using moved location
536
+ python "F:\Medibot\update_medicafe.py" --clear-cache
537
+ ) else if exist "MediBot\update_medicafe.py" (
538
+ echo Found update_medicafe.py in original location - using relative path
539
+ python "MediBot\update_medicafe.py" --clear-cache
540
+ ) else (
541
+ echo ERROR: update_medicafe.py not found in either location
542
+ echo Expected locations:
543
+ echo - F:\Medibot\update_medicafe.py
544
+ echo - MediBot\update_medicafe.py
545
+ pause
546
+ goto main_menu
547
+ )
548
+
549
+ if errorlevel 1 (
550
+ echo Cache clearing failed.
551
+ pause
552
+ ) else (
553
+ echo Cache clearing completed successfully.
554
+ pause
555
+ )
556
+ goto main_menu
557
+
523
558
  :: Exit Script
524
559
  :end_script
525
560
  echo Exiting MediCafe.
@@ -1,5 +1,5 @@
1
1
  #update_medicafe.py
2
- import subprocess, sys, time, platform
2
+ import subprocess, sys, time, platform, os, shutil
3
3
 
4
4
  # Safe import for pkg_resources with fallback
5
5
  try:
@@ -112,6 +112,87 @@ def check_internet_connection():
112
112
  except requests.ConnectionError:
113
113
  return False
114
114
 
115
+ def clear_python_cache(workspace_path=None):
116
+ """
117
+ Clear Python bytecode cache files to prevent import issues after updates.
118
+
119
+ Args:
120
+ workspace_path (str, optional): Path to the workspace root. If None,
121
+ will attempt to detect automatically.
122
+
123
+ Returns:
124
+ bool: True if cache was cleared successfully, False otherwise
125
+ """
126
+ try:
127
+ print_status("Clearing Python bytecode cache...", "INFO")
128
+
129
+ # If no workspace path provided, try to detect it
130
+ if not workspace_path:
131
+ # Try to find the MediCafe workspace by looking for common directories
132
+ current_dir = os.getcwd()
133
+ potential_paths = [
134
+ current_dir,
135
+ os.path.dirname(current_dir),
136
+ os.path.join(current_dir, '..'),
137
+ os.path.join(current_dir, '..', '..')
138
+ ]
139
+
140
+ for path in potential_paths:
141
+ if os.path.exists(os.path.join(path, 'MediCafe')) and \
142
+ os.path.exists(os.path.join(path, 'MediBot')) and \
143
+ os.path.exists(os.path.join(path, 'MediLink')):
144
+ workspace_path = path
145
+ break
146
+
147
+ if not workspace_path:
148
+ print_status("Could not detect workspace path. Cache clearing skipped.", "WARNING")
149
+ return False
150
+
151
+ print("Workspace path: {}".format(workspace_path))
152
+
153
+ # Directories to clear cache from
154
+ cache_dirs = [
155
+ os.path.join(workspace_path, 'MediCafe'),
156
+ os.path.join(workspace_path, 'MediBot'),
157
+ os.path.join(workspace_path, 'MediLink'),
158
+ workspace_path # Root workspace
159
+ ]
160
+
161
+ cleared_count = 0
162
+ for cache_dir in cache_dirs:
163
+ if os.path.exists(cache_dir):
164
+ # Remove __pycache__ directories
165
+ pycache_path = os.path.join(cache_dir, '__pycache__')
166
+ if os.path.exists(pycache_path):
167
+ try:
168
+ shutil.rmtree(pycache_path)
169
+ print("Cleared cache: {}".format(pycache_path))
170
+ cleared_count += 1
171
+ except Exception as e:
172
+ print("Warning: Could not clear cache at {}: {}".format(pycache_path, e))
173
+
174
+ # Remove .pyc files
175
+ for root, dirs, files in os.walk(cache_dir):
176
+ for file in files:
177
+ if file.endswith('.pyc'):
178
+ try:
179
+ os.remove(os.path.join(root, file))
180
+ print("Removed .pyc file: {}".format(os.path.join(root, file)))
181
+ cleared_count += 1
182
+ except Exception as e:
183
+ print("Warning: Could not remove .pyc file {}: {}".format(file, e))
184
+
185
+ if cleared_count > 0:
186
+ print_status("Successfully cleared {} cache items".format(cleared_count), "SUCCESS")
187
+ return True
188
+ else:
189
+ print_status("No cache files found to clear", "INFO")
190
+ return True
191
+
192
+ except Exception as e:
193
+ print_status("Error clearing cache: {}".format(e), "ERROR")
194
+ return False
195
+
115
196
  def compare_versions(version1, version2):
116
197
  v1_parts = list(map(int, version1.split(".")))
117
198
  v2_parts = list(map(int, version2.split(".")))
@@ -306,6 +387,14 @@ def main():
306
387
  new_version = get_installed_version(package)
307
388
  if compare_versions(new_version, latest_version) >= 0:
308
389
  print_status("Upgrade successful. New version: {}".format(new_version), "SUCCESS")
390
+
391
+ # Clear Python cache after successful upgrade
392
+ print_status("Clearing Python cache to prevent import issues...", "INFO")
393
+ if clear_python_cache():
394
+ print_status("Cache cleared successfully. Update complete.", "SUCCESS")
395
+ else:
396
+ print_status("Cache clearing failed, but update was successful.", "WARNING")
397
+
309
398
  print_final_result(True, "Successfully upgraded to version {}".format(new_version))
310
399
  else:
311
400
  print_status("Upgrade failed. Current version remains: {}".format(new_version), "ERROR")
@@ -317,8 +406,19 @@ def main():
317
406
  print_final_result(True, "Already running latest version")
318
407
 
319
408
  if __name__ == "__main__":
320
- if len(sys.argv) > 1 and sys.argv[1] == "--check-only":
321
- check_for_updates_only()
322
- sys.exit(0)
409
+ if len(sys.argv) > 1:
410
+ if sys.argv[1] == "--check-only":
411
+ check_for_updates_only()
412
+ sys.exit(0)
413
+ elif sys.argv[1] == "--clear-cache":
414
+ # Standalone cache clearing mode
415
+ print_status("MediCafe Cache Clearing Utility", "INFO")
416
+ workspace_path = sys.argv[2] if len(sys.argv) > 2 else None
417
+ if clear_python_cache(workspace_path):
418
+ print_status("Cache clearing completed successfully", "SUCCESS")
419
+ sys.exit(0)
420
+ else:
421
+ print_status("Cache clearing failed", "ERROR")
422
+ sys.exit(1)
323
423
  else:
324
424
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250806.0
3
+ Version: 0.250806.3
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,4 +1,4 @@
1
- MediBot/MediBot.bat,sha256=gSL5EyZJmAsrBo-7uJA2YLnYqAZKPuXugI9d1FCq2Os,22277
1
+ MediBot/MediBot.bat,sha256=h2CMYkTtZw_-kC0yintP94srAD6cx6PTwGDJD4PdAQQ,23298
2
2
  MediBot/MediBot.py,sha256=E1vE8AskTFf5lp8GVaJKXOUyKZTbi6t01f1taJmMwVQ,28779
3
3
  MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  MediBot/MediBot_Crosswalk_Library.py,sha256=X-lo8bvT-vmCqbrKFi_ApmVI6wQs53mz1ygyVeCf1SI,23463
@@ -15,7 +15,7 @@ MediBot/PDF_to_CSV_Cleaner.py,sha256=ZZphmq-5K04DkrZNlcwNAIoZPOD_ROWvS3PMkKFxeiM
15
15
  MediBot/__init__.py,sha256=mdTybtb5aRozmwDuAtf9nO8wv03HjNCDU0PnJy4Pwko,2957
16
16
  MediBot/get_medicafe_version.py,sha256=uyL_UIE42MyFuJ3SRYxJp8sZx8xjTqlYZ3FdQuxLduY,728
17
17
  MediBot/update_json.py,sha256=vvUF4mKCuaVly8MmoadDO59M231fCIInc0KI1EtDtPA,3704
18
- MediBot/update_medicafe.py,sha256=JWtNQMXGGKa9pIgKW08MK8tJWlHLq4BuXOUoG76OPQA,14735
18
+ MediBot/update_medicafe.py,sha256=SxBvETfpAx0_85gRmZ6C1nNb2kphbdGtLuw5rM_mgKM,19176
19
19
  MediCafe/MediLink_ConfigLoader.py,sha256=gCC4me808KzSNneRTj6h3IFwjERxP-Q9XQUayPZu7Ew,7009
20
20
  MediCafe/__init__.py,sha256=6bSEXGy35ljEeTv40LcsokC8riYGk6lRj1QDpSepwnA,5461
21
21
  MediCafe/__main__.py,sha256=Sr_4BHC3_o11472EEJ9qcrfuQLTyPZJHNqTTLb1yVx8,12050
@@ -73,9 +73,9 @@ MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,
73
73
  MediLink/test_timing.py,sha256=yH2b8QPLDlp1Zy5AhgtjzjnDHNGhAD16ZtXtZzzESZw,2042
74
74
  MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
75
75
  MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
76
- medicafe-0.250806.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
77
- medicafe-0.250806.0.dist-info/METADATA,sha256=OxrVmZrfLBc2FEyeBulJyNVEkYvNA_O9T8jSSrIMzpM,5501
78
- medicafe-0.250806.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
79
- medicafe-0.250806.0.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
80
- medicafe-0.250806.0.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
81
- medicafe-0.250806.0.dist-info/RECORD,,
76
+ medicafe-0.250806.3.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
77
+ medicafe-0.250806.3.dist-info/METADATA,sha256=jRx6RJEV3hHr8GC12mp-j1qVbWWCj-at_hTuMTqC5xg,5501
78
+ medicafe-0.250806.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
79
+ medicafe-0.250806.3.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
80
+ medicafe-0.250806.3.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
81
+ medicafe-0.250806.3.dist-info/RECORD,,