medicafe 0.250805.2__py3-none-any.whl → 0.250806.0__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/update_medicafe.py +63 -32
- MediLink/MediLink_Gmail.py +14 -0
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/METADATA +1 -1
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/RECORD +8 -8
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/LICENSE +0 -0
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/WHEEL +0 -0
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/entry_points.txt +0 -0
- {medicafe-0.250805.2.dist-info → medicafe-0.250806.0.dist-info}/top_level.txt +0 -0
MediBot/update_medicafe.py
CHANGED
|
@@ -15,6 +15,40 @@ except ImportError:
|
|
|
15
15
|
requests = None
|
|
16
16
|
print("Warning: requests module not available. Some functionality may be limited.")
|
|
17
17
|
|
|
18
|
+
def print_status(message, status_type="INFO"):
|
|
19
|
+
"""Print formatted status messages with ASCII-only visual indicators."""
|
|
20
|
+
if status_type == "SUCCESS":
|
|
21
|
+
print("\n" + "="*60)
|
|
22
|
+
print("[SUCCESS] {}".format(message))
|
|
23
|
+
print("="*60)
|
|
24
|
+
elif status_type == "ERROR":
|
|
25
|
+
print("\n" + "="*60)
|
|
26
|
+
print("[ERROR] {}".format(message))
|
|
27
|
+
print("="*60)
|
|
28
|
+
elif status_type == "WARNING":
|
|
29
|
+
print("\n" + "-"*60)
|
|
30
|
+
print("[WARNING] {}".format(message))
|
|
31
|
+
print("-"*60)
|
|
32
|
+
elif status_type == "INFO":
|
|
33
|
+
print("\n" + "-"*60)
|
|
34
|
+
print("[INFO] {}".format(message))
|
|
35
|
+
print("-"*60)
|
|
36
|
+
else:
|
|
37
|
+
print(message)
|
|
38
|
+
|
|
39
|
+
def print_final_result(success, message):
|
|
40
|
+
"""Print final result with clear visual indication."""
|
|
41
|
+
if success:
|
|
42
|
+
print_status("UPDATE COMPLETED SUCCESSFULLY", "SUCCESS")
|
|
43
|
+
print("Final Status: {}".format(message))
|
|
44
|
+
else:
|
|
45
|
+
print_status("UPDATE FAILED", "ERROR")
|
|
46
|
+
print("Final Status: {}".format(message))
|
|
47
|
+
|
|
48
|
+
print("\nExiting in 5 seconds...")
|
|
49
|
+
time.sleep(5)
|
|
50
|
+
sys.exit(0 if success else 1)
|
|
51
|
+
|
|
18
52
|
def get_installed_version(package):
|
|
19
53
|
try:
|
|
20
54
|
process = subprocess.Popen(
|
|
@@ -88,9 +122,8 @@ def upgrade_package(package, retries=3, delay=2): # Updated retries to 3
|
|
|
88
122
|
Attempts to upgrade the package multiple times with delays in between.
|
|
89
123
|
"""
|
|
90
124
|
if not check_internet_connection():
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
sys.exit(1)
|
|
125
|
+
print_status("No internet connection detected. Please check your internet connection and try again.", "ERROR")
|
|
126
|
+
print_final_result(False, "No internet connection available")
|
|
94
127
|
|
|
95
128
|
for attempt in range(1, retries + 1):
|
|
96
129
|
print("Attempt {} to upgrade {}...".format(attempt, package))
|
|
@@ -110,24 +143,24 @@ def upgrade_package(package, retries=3, delay=2): # Updated retries to 3
|
|
|
110
143
|
new_version = get_installed_version(package) # Get new version after upgrade
|
|
111
144
|
if compare_versions(new_version, get_latest_version(package)) >= 0: # Compare versions
|
|
112
145
|
if attempt == 1:
|
|
113
|
-
|
|
146
|
+
print_status("Upgrade succeeded!", "SUCCESS")
|
|
114
147
|
else:
|
|
115
|
-
|
|
148
|
+
print_status("Attempt {}: Upgrade succeeded!".format(attempt), "SUCCESS")
|
|
116
149
|
time.sleep(delay)
|
|
117
150
|
return True
|
|
118
151
|
else:
|
|
119
|
-
|
|
152
|
+
print_status("Upgrade failed. Current version remains: {}".format(new_version), "WARNING")
|
|
120
153
|
if attempt < retries:
|
|
121
154
|
print("Retrying in {} seconds...".format(delay))
|
|
122
155
|
time.sleep(delay)
|
|
123
156
|
else:
|
|
124
157
|
print(stderr.decode().strip())
|
|
125
|
-
|
|
158
|
+
print_status("Attempt {}: Upgrade failed.".format(attempt), "WARNING")
|
|
126
159
|
if attempt < retries:
|
|
127
160
|
print("Retrying in {} seconds...".format(delay))
|
|
128
161
|
time.sleep(delay)
|
|
129
162
|
|
|
130
|
-
|
|
163
|
+
print_status("All upgrade attempts failed.", "ERROR")
|
|
131
164
|
return False
|
|
132
165
|
|
|
133
166
|
def ensure_dependencies():
|
|
@@ -149,7 +182,7 @@ def ensure_dependencies():
|
|
|
149
182
|
is_windows_py34 = sys.version_info[:2] == (3, 4) and platform.system() == 'Windows'
|
|
150
183
|
|
|
151
184
|
if is_windows_py34:
|
|
152
|
-
|
|
185
|
+
print_status("Detected Windows with Python 3.4", "INFO")
|
|
153
186
|
print("Please ensure the following packages are installed manually:")
|
|
154
187
|
for pkg in problematic_packages:
|
|
155
188
|
package_name, version = pkg.split('==')
|
|
@@ -187,7 +220,7 @@ def ensure_dependencies():
|
|
|
187
220
|
print("Required version of {}: {}".format(package_name, version))
|
|
188
221
|
time.sleep(2) # Pause for 2 seconds to allow user to read the output
|
|
189
222
|
if not upgrade_package(package_name): # Attempt to upgrade/downgrade to the required version
|
|
190
|
-
|
|
223
|
+
print_status("Failed to upgrade/downgrade {} to version {}.".format(package_name, version), "WARNING")
|
|
191
224
|
time.sleep(2) # Pause for 2 seconds after failure message
|
|
192
225
|
elif version and installed_version == version: # Check if installed version matches required version
|
|
193
226
|
print("All versions match for {}. No changes needed.".format(package_name))
|
|
@@ -199,13 +232,13 @@ def ensure_dependencies():
|
|
|
199
232
|
print("Latest version of {}: {}".format(package_name, latest_version))
|
|
200
233
|
time.sleep(2) # Pause for 2 seconds to allow user to read the output
|
|
201
234
|
if not upgrade_package(package_name):
|
|
202
|
-
|
|
235
|
+
print_status("Failed to upgrade {}.".format(package_name), "WARNING")
|
|
203
236
|
time.sleep(2) # Pause for 2 seconds after failure message
|
|
204
237
|
except pkg_resources.DistributionNotFound:
|
|
205
238
|
print("Package {} is not installed. Attempting to install...".format(package_name))
|
|
206
239
|
time.sleep(2) # Pause for 2 seconds before attempting installation
|
|
207
240
|
if not upgrade_package(package_name):
|
|
208
|
-
|
|
241
|
+
print_status("Failed to install {}.".format(package_name), "WARNING")
|
|
209
242
|
time.sleep(2) # Pause for 2 seconds after failure message
|
|
210
243
|
|
|
211
244
|
def check_for_updates_only():
|
|
@@ -234,56 +267,54 @@ def check_for_updates_only():
|
|
|
234
267
|
print("UP_TO_DATE")
|
|
235
268
|
|
|
236
269
|
def main():
|
|
270
|
+
print_status("MediCafe Update Utility", "INFO")
|
|
271
|
+
print("Starting update process...")
|
|
272
|
+
|
|
237
273
|
# Ensure internet connection before proceeding
|
|
238
274
|
if not check_internet_connection():
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
sys.exit(1)
|
|
275
|
+
print_status("No internet connection. Please check your connection and try again.", "ERROR")
|
|
276
|
+
print_final_result(False, "No internet connection available")
|
|
242
277
|
|
|
243
278
|
# Ensure all dependencies are met before proceeding
|
|
244
279
|
response = input("Do you want to check dependencies? (yes/no, default/enter is no): ").strip().lower()
|
|
245
280
|
if response in ['yes', 'y']:
|
|
246
281
|
ensure_dependencies()
|
|
247
282
|
else:
|
|
248
|
-
|
|
283
|
+
print_status("Skipping dependency check.", "INFO")
|
|
249
284
|
time.sleep(3) # Pause for 3 seconds before proceeding
|
|
250
285
|
|
|
251
286
|
package = "medicafe"
|
|
252
287
|
|
|
253
288
|
current_version = get_installed_version(package)
|
|
254
289
|
if not current_version:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
sys.exit(1)
|
|
290
|
+
print_status("{} is not installed.".format(package), "ERROR")
|
|
291
|
+
print_final_result(False, "Package not installed")
|
|
258
292
|
|
|
259
293
|
latest_version = get_latest_version(package)
|
|
260
294
|
if not latest_version:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
sys.exit(1)
|
|
295
|
+
print_status("Could not retrieve the latest version information.", "ERROR")
|
|
296
|
+
print_final_result(False, "Unable to fetch latest version")
|
|
264
297
|
|
|
265
298
|
print("Current version of {}: {}".format(package, current_version))
|
|
266
299
|
print("Latest version of {}: {}".format(package, latest_version))
|
|
267
300
|
|
|
268
301
|
if compare_versions(latest_version, current_version) > 0:
|
|
269
|
-
|
|
302
|
+
print_status("A newer version is available. Proceeding with upgrade.", "INFO")
|
|
270
303
|
if upgrade_package(package):
|
|
271
304
|
# Verify upgrade
|
|
272
305
|
time.sleep(3)
|
|
273
306
|
new_version = get_installed_version(package)
|
|
274
307
|
if compare_versions(new_version, latest_version) >= 0:
|
|
275
|
-
|
|
308
|
+
print_status("Upgrade successful. New version: {}".format(new_version), "SUCCESS")
|
|
309
|
+
print_final_result(True, "Successfully upgraded to version {}".format(new_version))
|
|
276
310
|
else:
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
sys.exit(1)
|
|
311
|
+
print_status("Upgrade failed. Current version remains: {}".format(new_version), "ERROR")
|
|
312
|
+
print_final_result(False, "Upgrade verification failed")
|
|
280
313
|
else:
|
|
281
|
-
|
|
282
|
-
sys.exit(1)
|
|
314
|
+
print_final_result(False, "Upgrade process failed")
|
|
283
315
|
else:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
sys.exit(1)
|
|
316
|
+
print_status("You already have the latest version installed.", "SUCCESS")
|
|
317
|
+
print_final_result(True, "Already running latest version")
|
|
287
318
|
|
|
288
319
|
if __name__ == "__main__":
|
|
289
320
|
if len(sys.argv) > 1 and sys.argv[1] == "--check-only":
|
MediLink/MediLink_Gmail.py
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# MediLink_Gmail.py
|
|
2
2
|
import sys, os, subprocess, time, webbrowser, requests, json, ssl, signal
|
|
3
|
+
|
|
4
|
+
# Set up Python path to find MediCafe when running directly
|
|
5
|
+
def setup_python_path():
|
|
6
|
+
"""Set up Python path to find MediCafe package"""
|
|
7
|
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
+
workspace_root = os.path.dirname(current_dir)
|
|
9
|
+
|
|
10
|
+
# Add workspace root to Python path if not already present
|
|
11
|
+
if workspace_root not in sys.path:
|
|
12
|
+
sys.path.insert(0, workspace_root)
|
|
13
|
+
|
|
14
|
+
# Set up paths before importing MediCafe
|
|
15
|
+
setup_python_path()
|
|
16
|
+
|
|
3
17
|
from MediCafe.core_utils import get_shared_config_loader
|
|
4
18
|
|
|
5
19
|
# Get shared config loader
|
|
@@ -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
|
|
18
|
+
MediBot/update_medicafe.py,sha256=JWtNQMXGGKa9pIgKW08MK8tJWlHLq4BuXOUoG76OPQA,14735
|
|
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
|
|
@@ -49,7 +49,7 @@ MediLink/MediLink_Deductible_Validator.py,sha256=2g-lZd-Y5fJ1mfP87vM6oABg0t5Om-7
|
|
|
49
49
|
MediLink/MediLink_Display_Utils.py,sha256=Bl15Ofqh09KIYsNXzM6WIE97Gp_4RVUw43J0NUzIERY,3121
|
|
50
50
|
MediLink/MediLink_Down.py,sha256=vZEFNWa6drpXK8DCzt3DAlHdPGdhv3HoLnQh9cppT8o,11793
|
|
51
51
|
MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
|
|
52
|
-
MediLink/MediLink_Gmail.py,sha256=
|
|
52
|
+
MediLink/MediLink_Gmail.py,sha256=Wl8g9D-CpsBpmyvAAErL7T327RYy_sRR2gY3SHJbNx8,35807
|
|
53
53
|
MediLink/MediLink_GraphQL.py,sha256=O6OCaumT0zIC7YcIAwLOOYxiQnYhoMc48UL8ilNIBec,45720
|
|
54
54
|
MediLink/MediLink_Mailer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
MediLink/MediLink_Parser.py,sha256=w2ZD4minjwkaMz7nzP_r8v_Ow_uM5KHjpPSY8mIHcdE,9787
|
|
@@ -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.
|
|
77
|
-
medicafe-0.
|
|
78
|
-
medicafe-0.
|
|
79
|
-
medicafe-0.
|
|
80
|
-
medicafe-0.
|
|
81
|
-
medicafe-0.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|