medicafe 0.250820.4__py3-none-any.whl → 0.250820.5__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.
- MediBot/MediBot_debug.bat +217 -0
- MediBot/__init__.py +1 -1
- MediBot/clear_cache.bat +56 -0
- MediBot/crash_diagnostic.bat +325 -0
- MediBot/f_drive_diagnostic.bat +175 -0
- MediBot/full_debug_suite.bat +71 -0
- MediBot/process_csvs.bat +98 -0
- MediBot/update_medicafe.py +107 -5
- MediCafe/__init__.py +1 -1
- MediLink/__init__.py +1 -1
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/METADATA +1 -1
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/RECORD +16 -10
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/LICENSE +0 -0
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/WHEEL +0 -0
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/entry_points.txt +0 -0
- {medicafe-0.250820.4.dist-info → medicafe-0.250820.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,217 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
echo [DEBUG] ========================================
|
5
|
+
echo [DEBUG] MediBot Debug Version Starting
|
6
|
+
echo [DEBUG] ========================================
|
7
|
+
echo [DEBUG] Current directory: %CD%
|
8
|
+
echo [DEBUG] Current time: %TIME%
|
9
|
+
echo [DEBUG] Current date: %DATE%
|
10
|
+
echo [DEBUG] Press Enter to continue...
|
11
|
+
call :maybe_pause
|
12
|
+
|
13
|
+
echo [DEBUG] Step 1: Basic environment check
|
14
|
+
echo [DEBUG] Checking if we can access basic commands...
|
15
|
+
dir >nul 2>&1
|
16
|
+
if errorlevel 1 (
|
17
|
+
echo [ERROR] Basic dir command failed
|
18
|
+
pause
|
19
|
+
exit /b 1
|
20
|
+
) else (
|
21
|
+
echo [DEBUG] Basic dir command works
|
22
|
+
)
|
23
|
+
|
24
|
+
echo [DEBUG] Press Enter to continue...
|
25
|
+
call :maybe_pause
|
26
|
+
|
27
|
+
echo [DEBUG] Step 2: Python check
|
28
|
+
echo [DEBUG] Checking Python installation...
|
29
|
+
python --version >nul 2>&1
|
30
|
+
if errorlevel 1 (
|
31
|
+
echo [ERROR] Python not found or not in PATH
|
32
|
+
echo [DEBUG] Current PATH: %PATH%
|
33
|
+
echo [DEBUG] Press Enter to exit...
|
34
|
+
pause >nul
|
35
|
+
exit /b 1
|
36
|
+
) else (
|
37
|
+
echo [DEBUG] Python found successfully
|
38
|
+
python --version
|
39
|
+
)
|
40
|
+
|
41
|
+
echo [DEBUG] Press Enter to continue...
|
42
|
+
call :maybe_pause
|
43
|
+
|
44
|
+
echo [DEBUG] Step 3: Directory structure check
|
45
|
+
echo [DEBUG] Checking current directory contents...
|
46
|
+
dir /b
|
47
|
+
echo [DEBUG] Press Enter to continue...
|
48
|
+
call :maybe_pause
|
49
|
+
|
50
|
+
echo [DEBUG] Step 4: MediBot directory check
|
51
|
+
if exist "MediBot" (
|
52
|
+
echo [DEBUG] MediBot directory exists
|
53
|
+
echo [DEBUG] MediBot directory contents:
|
54
|
+
dir /b MediBot
|
55
|
+
) else (
|
56
|
+
echo [WARNING] MediBot directory not found
|
57
|
+
)
|
58
|
+
|
59
|
+
echo [DEBUG] Press Enter to continue...
|
60
|
+
call :maybe_pause
|
61
|
+
|
62
|
+
echo [DEBUG] Step 5: F: drive check
|
63
|
+
if exist "F:\" (
|
64
|
+
echo [DEBUG] F: drive exists
|
65
|
+
if exist "F:\Medibot" (
|
66
|
+
echo [DEBUG] F:\Medibot directory exists
|
67
|
+
echo [DEBUG] F:\Medibot contents:
|
68
|
+
dir /b "F:\Medibot" 2>nul || echo [ERROR] Cannot list F:\Medibot contents
|
69
|
+
) else (
|
70
|
+
echo [DEBUG] F:\Medibot directory does not exist
|
71
|
+
)
|
72
|
+
) else (
|
73
|
+
echo [DEBUG] F: drive does not exist
|
74
|
+
)
|
75
|
+
|
76
|
+
echo [DEBUG] Press Enter to continue...
|
77
|
+
call :maybe_pause
|
78
|
+
|
79
|
+
echo [DEBUG] Step 6: Python package check
|
80
|
+
echo [DEBUG] Checking MediCafe package...
|
81
|
+
python -c "import pkg_resources; print('MediCafe=='+pkg_resources.get_distribution('medicafe').version)" 2>nul
|
82
|
+
if errorlevel 1 (
|
83
|
+
echo [ERROR] MediCafe package not found or error accessing
|
84
|
+
) else (
|
85
|
+
echo [DEBUG] MediCafe package found
|
86
|
+
)
|
87
|
+
|
88
|
+
echo [DEBUG] Press Enter to continue...
|
89
|
+
pause >nul
|
90
|
+
|
91
|
+
echo [DEBUG] Step 7: Internet connectivity check
|
92
|
+
echo [DEBUG] Testing internet connectivity...
|
93
|
+
ping -n 1 google.com >nul 2>&1
|
94
|
+
if errorlevel 1 (
|
95
|
+
echo [WARNING] No internet connection detected
|
96
|
+
) else (
|
97
|
+
echo [DEBUG] Internet connection detected
|
98
|
+
)
|
99
|
+
|
100
|
+
echo [DEBUG] Press Enter to continue...
|
101
|
+
pause >nul
|
102
|
+
|
103
|
+
echo [DEBUG] Step 8: Configuration file check
|
104
|
+
set "config_file=MediBot\json\config.json"
|
105
|
+
echo [DEBUG] Checking for config file: %config_file%
|
106
|
+
if exist "%config_file%" (
|
107
|
+
echo [DEBUG] Config file exists
|
108
|
+
) else (
|
109
|
+
echo [WARNING] Config file not found
|
110
|
+
)
|
111
|
+
|
112
|
+
echo [DEBUG] Press Enter to continue...
|
113
|
+
pause >nul
|
114
|
+
|
115
|
+
echo [DEBUG] Step 9: Update script check
|
116
|
+
set "upgrade_medicafe_local=MediBot\update_medicafe.py"
|
117
|
+
set "upgrade_medicafe_legacy=F:\Medibot\update_medicafe.py"
|
118
|
+
|
119
|
+
echo [DEBUG] Checking for update scripts...
|
120
|
+
echo [DEBUG] Local path: %upgrade_medicafe_local%
|
121
|
+
echo [DEBUG] Legacy path: %upgrade_medicafe_legacy%
|
122
|
+
|
123
|
+
if exist "%upgrade_medicafe_local%" (
|
124
|
+
echo [DEBUG] Local update script found
|
125
|
+
) else (
|
126
|
+
echo [DEBUG] Local update script not found
|
127
|
+
)
|
128
|
+
|
129
|
+
if exist "%upgrade_medicafe_legacy%" (
|
130
|
+
echo [DEBUG] Legacy update script found
|
131
|
+
) else (
|
132
|
+
echo [DEBUG] Legacy update script not found
|
133
|
+
)
|
134
|
+
|
135
|
+
echo [DEBUG] Press Enter to continue...
|
136
|
+
pause >nul
|
137
|
+
|
138
|
+
if defined NON_INTERACTIVE goto skip_simple_menu_test
|
139
|
+
echo [DEBUG] Step 10: Simple menu test
|
140
|
+
echo [DEBUG] Testing menu functionality...
|
141
|
+
echo.
|
142
|
+
echo [DEBUG] Simple Menu Test
|
143
|
+
echo [DEBUG] 1. Test option 1
|
144
|
+
echo [DEBUG] 2. Test option 2
|
145
|
+
echo [DEBUG] 3. Exit
|
146
|
+
echo.
|
147
|
+
set /p test_choice="Enter test choice (1-3): "
|
148
|
+
|
149
|
+
if "!test_choice!"=="1" (
|
150
|
+
echo [DEBUG] Test option 1 selected
|
151
|
+
) else if "!test_choice!"=="2" (
|
152
|
+
echo [DEBUG] Test option 2 selected
|
153
|
+
) else if "!test_choice!"=="3" (
|
154
|
+
echo [DEBUG] Test exit selected
|
155
|
+
goto debug_exit
|
156
|
+
) else (
|
157
|
+
echo [DEBUG] Invalid choice: !test_choice!
|
158
|
+
)
|
159
|
+
|
160
|
+
echo [DEBUG] Press Enter to continue...
|
161
|
+
call :maybe_pause
|
162
|
+
|
163
|
+
:skip_simple_menu_test
|
164
|
+
echo [DEBUG] Step 11: Python module import test
|
165
|
+
echo [DEBUG] Testing Python module imports...
|
166
|
+
python -c "import sys; print('Python version:', sys.version)" 2>nul
|
167
|
+
if errorlevel 1 (
|
168
|
+
echo [ERROR] Python import test failed
|
169
|
+
) else (
|
170
|
+
echo [DEBUG] Python import test passed
|
171
|
+
)
|
172
|
+
|
173
|
+
echo [DEBUG] Press Enter to continue...
|
174
|
+
call :maybe_pause
|
175
|
+
|
176
|
+
echo [DEBUG] Step 12: MediCafe module test
|
177
|
+
echo [DEBUG] Testing MediCafe module import...
|
178
|
+
python -c "import MediCafe; print('MediCafe module imported successfully')" 2>nul
|
179
|
+
if errorlevel 1 (
|
180
|
+
echo [ERROR] MediCafe module import failed
|
181
|
+
) else (
|
182
|
+
echo [DEBUG] MediCafe module import passed
|
183
|
+
)
|
184
|
+
|
185
|
+
echo [DEBUG] Press Enter to continue...
|
186
|
+
call :maybe_pause
|
187
|
+
|
188
|
+
echo [DEBUG] Step 13: Final test - command execution
|
189
|
+
echo [DEBUG] Testing command execution...
|
190
|
+
echo [DEBUG] This will test if we can execute a simple command
|
191
|
+
echo [DEBUG] Command: echo Hello World
|
192
|
+
echo Hello World
|
193
|
+
if errorlevel 1 (
|
194
|
+
echo [ERROR] Command execution failed
|
195
|
+
) else (
|
196
|
+
echo [DEBUG] Command execution successful
|
197
|
+
)
|
198
|
+
|
199
|
+
echo [DEBUG] Press Enter to continue...
|
200
|
+
pause >nul
|
201
|
+
|
202
|
+
echo [DEBUG] ========================================
|
203
|
+
echo [DEBUG] All debug tests completed successfully
|
204
|
+
echo [DEBUG] ========================================
|
205
|
+
echo [DEBUG] Press Enter to exit...
|
206
|
+
call :maybe_pause
|
207
|
+
|
208
|
+
:debug_exit
|
209
|
+
echo [DEBUG] Exiting debug version
|
210
|
+
echo [DEBUG] Press Enter to exit...
|
211
|
+
call :maybe_pause
|
212
|
+
exit /b 0
|
213
|
+
|
214
|
+
:maybe_pause
|
215
|
+
if defined NON_INTERACTIVE goto :eof
|
216
|
+
pause >nul
|
217
|
+
goto :eof
|
MediBot/__init__.py
CHANGED
MediBot/clear_cache.bat
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
:: Determine script and workspace directories
|
5
|
+
set "script_dir=%~dp0"
|
6
|
+
set "workspace_root=%script_dir%.."
|
7
|
+
|
8
|
+
:: Paths for deep clear helper script
|
9
|
+
set "upgrade_medicafe_local=%script_dir%update_medicafe.py"
|
10
|
+
set "upgrade_medicafe_legacy=F:\Medibot\update_medicafe.py"
|
11
|
+
|
12
|
+
:: Mode selection from first argument
|
13
|
+
set "mode=%~1"
|
14
|
+
if /i "%mode%"=="--quick" goto quick_clear
|
15
|
+
if /i "%mode%"=="--deep" goto deep_clear
|
16
|
+
|
17
|
+
:: Default behavior (backwards compatible): deep clear
|
18
|
+
goto deep_clear
|
19
|
+
|
20
|
+
:quick_clear
|
21
|
+
echo Quick clearing Python cache...
|
22
|
+
cd /d "%workspace_root%"
|
23
|
+
python -Bc "import compileall; compileall.compile_dir('.', force=True)" 2>nul
|
24
|
+
for /d /r . %%d in (__pycache__) do @if exist "%%d" rd /s /q "%%d" 2>nul
|
25
|
+
echo [OK] Quick cache clear complete.
|
26
|
+
exit /b 0
|
27
|
+
|
28
|
+
:deep_clear
|
29
|
+
echo Deep cache clear (via update_medicafe.py)...
|
30
|
+
echo Workspace root: %workspace_root%
|
31
|
+
echo.
|
32
|
+
|
33
|
+
:: F: drive diagnostics (brief)
|
34
|
+
if exist "F:\" (
|
35
|
+
if exist "F:\Medibot" (
|
36
|
+
dir "F:\Medibot\update_medicafe.py" >nul 2>&1 && echo [OK] F:\Medibot\update_medicafe.py exists || echo [WARN] F:\Medibot\update_medicafe.py missing
|
37
|
+
) else (
|
38
|
+
echo [WARN] F:\Medibot directory does not exist
|
39
|
+
)
|
40
|
+
) else (
|
41
|
+
echo [WARN] F: drive is not accessible
|
42
|
+
)
|
43
|
+
|
44
|
+
:: Prefer F: updater first (ensures using shared, unlocked copy), then local
|
45
|
+
if exist "%upgrade_medicafe_legacy%" (
|
46
|
+
echo Using F: update_medicafe.py for deep clear
|
47
|
+
python "%upgrade_medicafe_legacy%" --clear-cache "%workspace_root%"
|
48
|
+
exit /b %ERRORLEVEL%
|
49
|
+
) else if exist "%~dp0update_medicafe.py" (
|
50
|
+
echo Using local update_medicafe.py for deep clear
|
51
|
+
python "%~dp0update_medicafe.py" --clear-cache "%workspace_root%"
|
52
|
+
exit /b %ERRORLEVEL%
|
53
|
+
) else (
|
54
|
+
echo ERROR: update_medicafe.py not found (F: or local)
|
55
|
+
exit /b 1
|
56
|
+
)
|
@@ -0,0 +1,325 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
echo ========================================
|
5
|
+
echo MediBot Crash Diagnostic Tool
|
6
|
+
echo ========================================
|
7
|
+
echo.
|
8
|
+
echo This tool will help identify where MediBot.bat is crashing
|
9
|
+
echo on the XP production machine.
|
10
|
+
echo.
|
11
|
+
echo Press Enter to start diagnostics...
|
12
|
+
call :maybe_pause
|
13
|
+
|
14
|
+
:: Test 1: Basic batch functionality
|
15
|
+
echo.
|
16
|
+
echo ========================================
|
17
|
+
echo Test 1: Basic Batch Functionality
|
18
|
+
echo ========================================
|
19
|
+
echo Testing basic batch commands...
|
20
|
+
echo Current directory: %CD%
|
21
|
+
echo Current time: %TIME%
|
22
|
+
echo Current date: %DATE%
|
23
|
+
echo.
|
24
|
+
echo Testing variable expansion...
|
25
|
+
set "test_var=Hello World"
|
26
|
+
echo Test variable: %test_var%
|
27
|
+
echo Delayed expansion test: !test_var!
|
28
|
+
echo.
|
29
|
+
echo Test 1 PASSED - Basic batch functionality works
|
30
|
+
echo Press Enter to continue...
|
31
|
+
call :maybe_pause
|
32
|
+
|
33
|
+
:: Test 2: Python installation
|
34
|
+
echo.
|
35
|
+
echo ========================================
|
36
|
+
echo Test 2: Python Installation
|
37
|
+
echo ========================================
|
38
|
+
echo Testing Python installation...
|
39
|
+
python --version >nul 2>&1
|
40
|
+
if errorlevel 1 (
|
41
|
+
echo ERROR: Python not found or not in PATH
|
42
|
+
echo Current PATH: %PATH%
|
43
|
+
echo.
|
44
|
+
echo Test 2 FAILED - Python not available
|
45
|
+
echo Press Enter to continue anyway...
|
46
|
+
call :maybe_pause
|
47
|
+
) else (
|
48
|
+
echo Python found successfully
|
49
|
+
python --version
|
50
|
+
echo.
|
51
|
+
echo Test 2 PASSED - Python installation OK
|
52
|
+
echo Press Enter to continue...
|
53
|
+
call :maybe_pause
|
54
|
+
)
|
55
|
+
|
56
|
+
:: Test 3: Directory structure
|
57
|
+
echo.
|
58
|
+
echo ========================================
|
59
|
+
echo Test 3: Directory Structure
|
60
|
+
echo ========================================
|
61
|
+
echo Testing directory structure...
|
62
|
+
echo Current directory contents:
|
63
|
+
dir /b
|
64
|
+
echo.
|
65
|
+
echo Testing MediBot directory:
|
66
|
+
if exist "MediBot" (
|
67
|
+
echo MediBot directory exists
|
68
|
+
echo MediBot contents:
|
69
|
+
dir /b MediBot
|
70
|
+
) else (
|
71
|
+
echo WARNING: MediBot directory not found
|
72
|
+
)
|
73
|
+
echo.
|
74
|
+
echo Test 3 PASSED - Directory structure checked
|
75
|
+
echo Press Enter to continue...
|
76
|
+
call :maybe_pause
|
77
|
+
|
78
|
+
:: Test 4: F: drive access
|
79
|
+
echo.
|
80
|
+
echo ========================================
|
81
|
+
echo Test 4: F: Drive Access
|
82
|
+
echo ========================================
|
83
|
+
echo Testing F: drive access...
|
84
|
+
if exist "F:\" (
|
85
|
+
echo F: drive exists
|
86
|
+
if exist "F:\Medibot" (
|
87
|
+
echo F:\Medibot directory exists
|
88
|
+
echo F:\Medibot contents:
|
89
|
+
dir /b "F:\Medibot" 2>nul || echo Cannot list F:\Medibot contents
|
90
|
+
) else (
|
91
|
+
echo F:\Medibot directory does not exist
|
92
|
+
)
|
93
|
+
) else (
|
94
|
+
echo F: drive does not exist
|
95
|
+
)
|
96
|
+
echo.
|
97
|
+
echo Test 4 PASSED - F: drive access checked
|
98
|
+
echo Press Enter to continue...
|
99
|
+
call :maybe_pause
|
100
|
+
|
101
|
+
:: Test 5: Python package access
|
102
|
+
echo.
|
103
|
+
echo ========================================
|
104
|
+
echo Test 5: Python Package Access
|
105
|
+
echo ========================================
|
106
|
+
echo Testing Python package access...
|
107
|
+
echo Testing pkg_resources import...
|
108
|
+
python -c "import pkg_resources" 2>nul
|
109
|
+
if errorlevel 1 (
|
110
|
+
echo ERROR: pkg_resources not available
|
111
|
+
) else (
|
112
|
+
echo pkg_resources import successful
|
113
|
+
)
|
114
|
+
|
115
|
+
echo Testing MediCafe package...
|
116
|
+
python -c "import pkg_resources; print('MediCafe=='+pkg_resources.get_distribution('medicafe').version)" 2>nul
|
117
|
+
if errorlevel 1 (
|
118
|
+
echo ERROR: MediCafe package not found or error accessing
|
119
|
+
) else (
|
120
|
+
echo MediCafe package found
|
121
|
+
)
|
122
|
+
echo.
|
123
|
+
echo Test 5 PASSED - Python package access checked
|
124
|
+
echo Press Enter to continue...
|
125
|
+
call :maybe_pause
|
126
|
+
|
127
|
+
:: Test 6: Internet connectivity
|
128
|
+
echo.
|
129
|
+
echo ========================================
|
130
|
+
echo Test 6: Internet Connectivity
|
131
|
+
echo ========================================
|
132
|
+
echo Testing internet connectivity...
|
133
|
+
ping -n 1 google.com >nul 2>&1
|
134
|
+
if errorlevel 1 (
|
135
|
+
echo WARNING: No internet connection detected
|
136
|
+
) else (
|
137
|
+
echo Internet connection detected
|
138
|
+
)
|
139
|
+
echo.
|
140
|
+
echo Test 6 PASSED - Internet connectivity checked
|
141
|
+
echo Press Enter to continue...
|
142
|
+
call :maybe_pause
|
143
|
+
|
144
|
+
:: Test 7: Configuration file
|
145
|
+
echo.
|
146
|
+
echo ========================================
|
147
|
+
echo Test 7: Configuration File
|
148
|
+
echo ========================================
|
149
|
+
echo Testing configuration file access...
|
150
|
+
set "config_file=MediBot\json\config.json"
|
151
|
+
echo Checking for config file: %config_file%
|
152
|
+
if exist "%config_file%" (
|
153
|
+
echo Config file exists
|
154
|
+
) else (
|
155
|
+
echo WARNING: Config file not found
|
156
|
+
)
|
157
|
+
echo.
|
158
|
+
echo Test 7 PASSED - Configuration file checked
|
159
|
+
echo Press Enter to continue...
|
160
|
+
call :maybe_pause
|
161
|
+
|
162
|
+
:: Test 8: Update script files
|
163
|
+
echo.
|
164
|
+
echo ========================================
|
165
|
+
echo Test 8: Update Script Files
|
166
|
+
echo ========================================
|
167
|
+
echo Testing update script files...
|
168
|
+
set "upgrade_medicafe_local=MediBot\update_medicafe.py"
|
169
|
+
set "upgrade_medicafe_legacy=F:\Medibot\update_medicafe.py"
|
170
|
+
|
171
|
+
echo Checking local update script: %upgrade_medicafe_local%
|
172
|
+
if exist "%upgrade_medicafe_local%" (
|
173
|
+
echo Local update script found
|
174
|
+
) else (
|
175
|
+
echo Local update script not found
|
176
|
+
)
|
177
|
+
|
178
|
+
echo Checking legacy update script: %upgrade_medicafe_legacy%
|
179
|
+
if exist "%upgrade_medicafe_legacy%" (
|
180
|
+
echo Legacy update script found
|
181
|
+
) else (
|
182
|
+
echo Legacy update script not found
|
183
|
+
)
|
184
|
+
echo.
|
185
|
+
echo Test 8 PASSED - Update script files checked
|
186
|
+
echo Press Enter to continue...
|
187
|
+
call :maybe_pause
|
188
|
+
|
189
|
+
:: Test 9: Python module imports
|
190
|
+
echo.
|
191
|
+
echo ========================================
|
192
|
+
echo Test 9: Python Module Imports
|
193
|
+
echo ========================================
|
194
|
+
echo Testing Python module imports...
|
195
|
+
echo Testing sys module...
|
196
|
+
python -c "import sys; print('Python version:', sys.version)" 2>nul
|
197
|
+
if errorlevel 1 (
|
198
|
+
echo ERROR: sys module import failed
|
199
|
+
) else (
|
200
|
+
echo sys module import successful
|
201
|
+
)
|
202
|
+
|
203
|
+
echo Testing MediCafe module...
|
204
|
+
python -c "import MediCafe" 2>nul
|
205
|
+
if errorlevel 1 (
|
206
|
+
echo ERROR: MediCafe module import failed
|
207
|
+
) else (
|
208
|
+
echo MediCafe module import successful
|
209
|
+
)
|
210
|
+
echo.
|
211
|
+
echo Test 9 PASSED - Python module imports checked
|
212
|
+
echo Press Enter to continue...
|
213
|
+
call :maybe_pause
|
214
|
+
|
215
|
+
:: Test 10: Command execution
|
216
|
+
echo.
|
217
|
+
echo ========================================
|
218
|
+
echo Test 10: Command Execution
|
219
|
+
echo ========================================
|
220
|
+
echo Testing command execution...
|
221
|
+
echo Testing simple command...
|
222
|
+
echo Hello World
|
223
|
+
if errorlevel 1 (
|
224
|
+
echo ERROR: Simple command execution failed
|
225
|
+
) else (
|
226
|
+
echo Simple command execution successful
|
227
|
+
)
|
228
|
+
|
229
|
+
echo Testing Python command execution...
|
230
|
+
python -c "print('Python command execution test')" 2>nul
|
231
|
+
if errorlevel 1 (
|
232
|
+
echo ERROR: Python command execution failed
|
233
|
+
) else (
|
234
|
+
echo Python command execution successful
|
235
|
+
)
|
236
|
+
echo.
|
237
|
+
echo Test 10 PASSED - Command execution checked
|
238
|
+
echo Press Enter to continue...
|
239
|
+
call :maybe_pause
|
240
|
+
|
241
|
+
:: Test 11: File operations
|
242
|
+
echo.
|
243
|
+
echo ========================================
|
244
|
+
echo Test 11: File Operations
|
245
|
+
echo ========================================
|
246
|
+
echo Testing file operations...
|
247
|
+
echo Creating test file...
|
248
|
+
echo Test content > test_file.txt
|
249
|
+
if exist "test_file.txt" (
|
250
|
+
echo Test file created successfully
|
251
|
+
echo Test file contents:
|
252
|
+
type test_file.txt
|
253
|
+
echo Deleting test file...
|
254
|
+
del test_file.txt
|
255
|
+
if not exist "test_file.txt" (
|
256
|
+
echo Test file deleted successfully
|
257
|
+
) else (
|
258
|
+
echo ERROR: Could not delete test file
|
259
|
+
)
|
260
|
+
) else (
|
261
|
+
echo ERROR: Could not create test file
|
262
|
+
)
|
263
|
+
echo.
|
264
|
+
echo Test 11 PASSED - File operations checked
|
265
|
+
echo Press Enter to continue...
|
266
|
+
pause >nul
|
267
|
+
|
268
|
+
:: Test 12: Menu functionality
|
269
|
+
if not defined NON_INTERACTIVE (
|
270
|
+
echo.
|
271
|
+
echo ========================================
|
272
|
+
echo Test 12: Menu Functionality
|
273
|
+
echo ========================================
|
274
|
+
echo Testing menu functionality...
|
275
|
+
echo.
|
276
|
+
echo Test Menu:
|
277
|
+
echo 1. Option 1
|
278
|
+
echo 2. Option 2
|
279
|
+
echo 3. Exit
|
280
|
+
echo.
|
281
|
+
set /p menu_choice="Enter choice (1-3): "
|
282
|
+
if "!menu_choice!"=="1" (
|
283
|
+
echo Option 1 selected
|
284
|
+
) else if "!menu_choice!"=="2" (
|
285
|
+
echo Option 2 selected
|
286
|
+
) else if "!menu_choice!"=="3" (
|
287
|
+
echo Exit selected
|
288
|
+
) else (
|
289
|
+
echo Invalid choice: !menu_choice!
|
290
|
+
)
|
291
|
+
echo.
|
292
|
+
echo Test 12 PASSED - Menu functionality checked
|
293
|
+
echo Press Enter to continue...
|
294
|
+
call :maybe_pause
|
295
|
+
)
|
296
|
+
|
297
|
+
:: Final summary
|
298
|
+
echo.
|
299
|
+
echo ========================================
|
300
|
+
echo DIAGNOSTIC SUMMARY
|
301
|
+
echo ========================================
|
302
|
+
echo.
|
303
|
+
echo All diagnostic tests completed.
|
304
|
+
echo.
|
305
|
+
echo If the batch file is still crashing, the issue is likely:
|
306
|
+
echo 1. A specific command or operation not tested here
|
307
|
+
echo 2. A timing issue or race condition
|
308
|
+
echo 3. A specific file or path that doesn't exist
|
309
|
+
echo 4. A Python module dependency issue
|
310
|
+
echo 5. A Windows XP compatibility issue
|
311
|
+
echo.
|
312
|
+
echo Recommendations:
|
313
|
+
echo 1. Run the debug version (MediBot_debug.bat) to see exactly where it fails
|
314
|
+
echo 2. Check Windows Event Viewer for any error messages
|
315
|
+
echo 3. Try running the batch file from a command prompt to see error output
|
316
|
+
echo 4. Check if any antivirus software is blocking the execution
|
317
|
+
echo.
|
318
|
+
echo Press Enter to exit...
|
319
|
+
call :maybe_pause
|
320
|
+
exit /b 0
|
321
|
+
|
322
|
+
:maybe_pause
|
323
|
+
if defined NON_INTERACTIVE goto :eof
|
324
|
+
pause >nul
|
325
|
+
goto :eof
|
@@ -0,0 +1,175 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
echo [DIAGNOSTIC] ========================================
|
5
|
+
echo [DIAGNOSTIC] F: Drive and update_medicafe.py Diagnostic
|
6
|
+
echo [DIAGNOSTIC] ========================================
|
7
|
+
if defined NON_INTERACTIVE (
|
8
|
+
echo [DIAGNOSTIC] NON_INTERACTIVE detected - skipping F: drive diagnostics to avoid hangs
|
9
|
+
exit /b 0
|
10
|
+
)
|
11
|
+
echo [DIAGNOSTIC] Current directory: %CD%
|
12
|
+
echo [DIAGNOSTIC] Current time: %TIME%
|
13
|
+
echo [DIAGNOSTIC] Press Enter to start diagnostics...
|
14
|
+
call :maybe_pause
|
15
|
+
|
16
|
+
echo.
|
17
|
+
echo [DIAGNOSTIC] STEP 1: Checking F: drive existence
|
18
|
+
echo [DIAGNOSTIC] ========================================
|
19
|
+
if exist "F:\" (
|
20
|
+
echo [SUCCESS] F: drive exists
|
21
|
+
echo [DIAGNOSTIC] F: drive contents:
|
22
|
+
dir /b "F:\" 2>nul || echo [ERROR] Cannot list F: drive contents
|
23
|
+
) else (
|
24
|
+
echo [ERROR] F: drive does not exist
|
25
|
+
)
|
26
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
27
|
+
call :maybe_pause
|
28
|
+
|
29
|
+
echo.
|
30
|
+
echo [DIAGNOSTIC] STEP 2: Checking F:\Medibot directory
|
31
|
+
echo [DIAGNOSTIC] ========================================
|
32
|
+
if exist "F:\Medibot" (
|
33
|
+
echo [SUCCESS] F:\Medibot directory exists
|
34
|
+
echo [DIAGNOSTIC] F:\Medibot contents:
|
35
|
+
dir /b "F:\Medibot" 2>nul || echo [ERROR] Cannot list F:\Medibot contents
|
36
|
+
) else (
|
37
|
+
echo [ERROR] F:\Medibot directory does not exist
|
38
|
+
)
|
39
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
40
|
+
call :maybe_pause
|
41
|
+
|
42
|
+
echo.
|
43
|
+
echo [DIAGNOSTIC] STEP 3: Checking for update_medicafe.py in F:\Medibot
|
44
|
+
echo [DIAGNOSTIC] ========================================
|
45
|
+
if exist "F:\Medibot\update_medicafe.py" (
|
46
|
+
echo [SUCCESS] F:\Medibot\update_medicafe.py exists
|
47
|
+
echo [DIAGNOSTIC] File details:
|
48
|
+
dir "F:\Medibot\update_medicafe.py" 2>nul || echo [ERROR] Cannot get file details
|
49
|
+
) else (
|
50
|
+
echo [ERROR] F:\Medibot\update_medicafe.py does not exist
|
51
|
+
)
|
52
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
53
|
+
call :maybe_pause
|
54
|
+
|
55
|
+
echo.
|
56
|
+
echo [DIAGNOSTIC] STEP 4: Checking local update_medicafe.py
|
57
|
+
echo [DIAGNOSTIC] ========================================
|
58
|
+
if exist "MediBot\update_medicafe.py" (
|
59
|
+
echo [SUCCESS] Local MediBot\update_medicafe.py exists
|
60
|
+
echo [DIAGNOSTIC] File details:
|
61
|
+
dir "MediBot\update_medicafe.py" 2>nul || echo [ERROR] Cannot get file details
|
62
|
+
) else (
|
63
|
+
echo [ERROR] Local MediBot\update_medicafe.py does not exist
|
64
|
+
)
|
65
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
66
|
+
call :maybe_pause
|
67
|
+
|
68
|
+
echo.
|
69
|
+
echo [DIAGNOSTIC] STEP 5: Testing Python access to F: drive file
|
70
|
+
echo [DIAGNOSTIC] ========================================
|
71
|
+
if exist "F:\Medibot\update_medicafe.py" (
|
72
|
+
echo [DIAGNOSTIC] Testing Python access to F:\Medibot\update_medicafe.py...
|
73
|
+
python -c "import os; print('[SUCCESS] Python can access F: drive file') if os.path.exists('F:\\Medibot\\update_medicafe.py') else print('[ERROR] Python cannot access F: drive file')" 2>nul
|
74
|
+
if errorlevel 1 (
|
75
|
+
echo [ERROR] Python test failed for F: drive file
|
76
|
+
)
|
77
|
+
) else (
|
78
|
+
echo [WARNING] Skipping Python test - F: drive file does not exist
|
79
|
+
)
|
80
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
81
|
+
call :maybe_pause
|
82
|
+
|
83
|
+
echo.
|
84
|
+
echo [DIAGNOSTIC] STEP 6: Testing Python access to local file
|
85
|
+
echo [DIAGNOSTIC] ========================================
|
86
|
+
if exist "MediBot\update_medicafe.py" (
|
87
|
+
echo [DIAGNOSTIC] Testing Python access to local MediBot\update_medicafe.py...
|
88
|
+
python -c "import os; print('[SUCCESS] Python can access local file') if os.path.exists('MediBot\\update_medicafe.py') else print('[ERROR] Python cannot access local file')" 2>nul
|
89
|
+
if errorlevel 1 (
|
90
|
+
echo [ERROR] Python test failed for local file
|
91
|
+
)
|
92
|
+
) else (
|
93
|
+
echo [WARNING] Skipping Python test - local file does not exist
|
94
|
+
)
|
95
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
96
|
+
call :maybe_pause
|
97
|
+
|
98
|
+
echo.
|
99
|
+
echo [DIAGNOSTIC] STEP 7: Testing actual Python execution of F: drive file
|
100
|
+
echo [DIAGNOSTIC] ========================================
|
101
|
+
if exist "F:\Medibot\update_medicafe.py" (
|
102
|
+
echo [DIAGNOSTIC] Testing Python execution of F:\Medibot\update_medicafe.py...
|
103
|
+
echo [DIAGNOSTIC] This will test if Python can actually run the file
|
104
|
+
echo [DIAGNOSTIC] Command: python "F:\Medibot\update_medicafe.py" --help
|
105
|
+
python "F:\Medibot\update_medicafe.py" --help 2>nul
|
106
|
+
if errorlevel 1 (
|
107
|
+
echo [ERROR] Python execution of F: drive file failed
|
108
|
+
echo [DIAGNOSTIC] This is likely the source of the "can't find" error
|
109
|
+
) else (
|
110
|
+
echo [SUCCESS] Python execution of F: drive file succeeded
|
111
|
+
)
|
112
|
+
) else (
|
113
|
+
echo [WARNING] Skipping execution test - F: drive file does not exist
|
114
|
+
)
|
115
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
116
|
+
call :maybe_pause
|
117
|
+
|
118
|
+
echo.
|
119
|
+
echo [DIAGNOSTIC] STEP 8: Testing actual Python execution of local file
|
120
|
+
echo [DIAGNOSTIC] ========================================
|
121
|
+
if exist "MediBot\update_medicafe.py" (
|
122
|
+
echo [DIAGNOSTIC] Testing Python execution of local MediBot\update_medicafe.py...
|
123
|
+
echo [DIAGNOSTIC] This will test if Python can actually run the local file
|
124
|
+
echo [DIAGNOSTIC] Command: python "MediBot\update_medicafe.py" --help
|
125
|
+
python "MediBot\update_medicafe.py" --help 2>nul
|
126
|
+
if errorlevel 1 (
|
127
|
+
echo [ERROR] Python execution of local file failed
|
128
|
+
) else (
|
129
|
+
echo [SUCCESS] Python execution of local file succeeded
|
130
|
+
)
|
131
|
+
) else (
|
132
|
+
echo [WARNING] Skipping execution test - local file does not exist
|
133
|
+
)
|
134
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
135
|
+
call :maybe_pause
|
136
|
+
|
137
|
+
echo.
|
138
|
+
echo [DIAGNOSTIC] STEP 9: Checking Python PATH and environment
|
139
|
+
echo [DIAGNOSTIC] ========================================
|
140
|
+
echo [DIAGNOSTIC] Python version:
|
141
|
+
python --version 2>nul || echo [ERROR] Python not found
|
142
|
+
echo [DIAGNOSTIC] Python executable location:
|
143
|
+
python -c "import sys; print(sys.executable)" 2>nul || echo [ERROR] Cannot determine python executable path
|
144
|
+
echo [DIAGNOSTIC] Current PATH:
|
145
|
+
echo %PATH%
|
146
|
+
echo [DIAGNOSTIC] Press Enter to continue...
|
147
|
+
call :maybe_pause
|
148
|
+
|
149
|
+
echo.
|
150
|
+
echo [DIAGNOSTIC] STEP 10: Summary and recommendations
|
151
|
+
echo [DIAGNOSTIC] ========================================
|
152
|
+
echo [DIAGNOSTIC] Based on the diagnostics above:
|
153
|
+
echo [DIAGNOSTIC]
|
154
|
+
if exist "F:\Medibot\update_medicafe.py" (
|
155
|
+
echo [DIAGNOSTIC] - F: drive file exists but may have access issues
|
156
|
+
) else (
|
157
|
+
echo [DIAGNOSTIC] - F: drive file does not exist (this is the main issue)
|
158
|
+
)
|
159
|
+
if exist "MediBot\update_medicafe.py" (
|
160
|
+
echo [DIAGNOSTIC] - Local file exists and should be used instead
|
161
|
+
) else (
|
162
|
+
echo [DIAGNOSTIC] - Local file also missing (critical issue)
|
163
|
+
)
|
164
|
+
echo [DIAGNOSTIC]
|
165
|
+
echo [DIAGNOSTIC] RECOMMENDATION: The batch file should prioritize the local
|
166
|
+
echo [DIAGNOSTIC] MediBot\update_medicafe.py file over the F: drive version.
|
167
|
+
echo [DIAGNOSTIC]
|
168
|
+
echo [DIAGNOSTIC] Press Enter to exit...
|
169
|
+
call :maybe_pause
|
170
|
+
exit /b 0
|
171
|
+
|
172
|
+
:maybe_pause
|
173
|
+
if defined NON_INTERACTIVE goto :eof
|
174
|
+
pause >nul
|
175
|
+
goto :eof
|
@@ -0,0 +1,71 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
echo ========================================
|
5
|
+
echo FULL DEBUG SUITE START
|
6
|
+
echo ========================================
|
7
|
+
if /I "%~1"=="/interactive" (
|
8
|
+
set "NON_INTERACTIVE="
|
9
|
+
echo Running diagnostics interactively...
|
10
|
+
) else (
|
11
|
+
set "NON_INTERACTIVE=1"
|
12
|
+
echo Running diagnostics non-interactively...
|
13
|
+
)
|
14
|
+
echo.
|
15
|
+
|
16
|
+
:: F: Drive Diagnostic
|
17
|
+
if defined NON_INTERACTIVE (
|
18
|
+
echo [SKIP] F: Drive diagnostic skipped in NON_INTERACTIVE mode
|
19
|
+
) else (
|
20
|
+
call "%~dp0f_drive_diagnostic.bat"
|
21
|
+
if errorlevel 1 (
|
22
|
+
echo [WARN] F: Drive diagnostic reported issues
|
23
|
+
) else (
|
24
|
+
echo [OK] F: Drive diagnostic passed
|
25
|
+
)
|
26
|
+
)
|
27
|
+
|
28
|
+
:: Crash Diagnostic
|
29
|
+
if defined NON_INTERACTIVE (
|
30
|
+
echo [SKIP] Crash diagnostic skipped in NON_INTERACTIVE mode
|
31
|
+
) else (
|
32
|
+
call "%~dp0crash_diagnostic.bat"
|
33
|
+
if errorlevel 1 (
|
34
|
+
echo [WARN] Crash diagnostic reported issues
|
35
|
+
) else (
|
36
|
+
echo [OK] Crash diagnostic passed
|
37
|
+
)
|
38
|
+
)
|
39
|
+
|
40
|
+
:: Basic Debug
|
41
|
+
if defined NON_INTERACTIVE (
|
42
|
+
echo [SKIP] Basic debug skipped in NON_INTERACTIVE mode
|
43
|
+
) else (
|
44
|
+
call "%~dp0MediBot_debug.bat"
|
45
|
+
if errorlevel 1 (
|
46
|
+
echo [WARN] Basic debug reported issues
|
47
|
+
) else (
|
48
|
+
echo [OK] Basic debug passed
|
49
|
+
)
|
50
|
+
)
|
51
|
+
|
52
|
+
:: Fixed Version Test removed (redundant script)
|
53
|
+
|
54
|
+
:: Additional automated checks
|
55
|
+
python --version >nul 2>&1 && echo [OK] Python found || echo [ERROR] Python not found in PATH
|
56
|
+
python -c "import pkg_resources; print('MediCafe=='+pkg_resources.get_distribution('medicafe').version)" >nul 2>&1 && echo [OK] MediCafe package found || echo [WARN] MediCafe package missing
|
57
|
+
ping -n 1 google.com >nul 2>&1 && echo [OK] Internet connectivity OK || echo [WARN] No internet
|
58
|
+
if exist "%~dp0update_medicafe.py" (echo [OK] Local update_medicafe.py present) else (echo [WARN] Local update_medicafe.py missing)
|
59
|
+
if exist "F:\" (
|
60
|
+
if exist "F:\Medibot\update_medicafe.py" (echo [OK] F:\Medibot\update_medicafe.py present) else (echo [WARN] F: update script missing)
|
61
|
+
) else (
|
62
|
+
echo [WARN] F: drive not accessible
|
63
|
+
)
|
64
|
+
|
65
|
+
echo.
|
66
|
+
echo ========================================
|
67
|
+
echo FULL DEBUG SUITE DONE
|
68
|
+
echo ========================================
|
69
|
+
endlocal & exit /b 0
|
70
|
+
|
71
|
+
|
MediBot/process_csvs.bat
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
@echo off
|
2
|
+
setlocal enabledelayedexpansion
|
3
|
+
|
4
|
+
echo source_folder=%source_folder%
|
5
|
+
echo target_folder=%target_folder%
|
6
|
+
echo local_storage_path=%local_storage_path%
|
7
|
+
echo python_script=%python_script%
|
8
|
+
echo config_file=%config_file%
|
9
|
+
echo.
|
10
|
+
|
11
|
+
:: Expects these to be set by caller (MediBot.bat):
|
12
|
+
:: %source_folder% %target_folder% %python_script% %config_file% %local_storage_path%
|
13
|
+
|
14
|
+
:: Validate JSON update script path or prompt for alternate
|
15
|
+
if not exist "%python_script%" (
|
16
|
+
echo.
|
17
|
+
echo Warning: Python script for JSON updates not found at: %python_script%
|
18
|
+
echo.
|
19
|
+
set /p provide_alt_json="Enter 'Y' to provide alternate path, or any other key to continue: "
|
20
|
+
if /i "!provide_alt_json!"=="Y" (
|
21
|
+
echo.
|
22
|
+
echo Please enter the full path to your update_json.py file.
|
23
|
+
echo Example: C:\MediBot\scripts\update_json.py
|
24
|
+
echo Example with spaces: "G:\My Drive\MediBot\scripts\update_json.py"
|
25
|
+
echo.
|
26
|
+
set /p alt_json_path="Enter JSON update script path: "
|
27
|
+
set "alt_json_path=!alt_json_path:"=!"
|
28
|
+
if exist "!alt_json_path!" (
|
29
|
+
echo JSON update script found at: !alt_json_path!
|
30
|
+
set "python_script=!alt_json_path!"
|
31
|
+
) else (
|
32
|
+
echo JSON update script not found at: !alt_json_path!
|
33
|
+
echo Continuing without JSON update script...
|
34
|
+
)
|
35
|
+
) else (
|
36
|
+
echo Continuing without JSON update script...
|
37
|
+
)
|
38
|
+
)
|
39
|
+
|
40
|
+
:: Move any CSVs from local storage to source folder
|
41
|
+
if defined local_storage_path if exist "%local_storage_path%\*.csv" (
|
42
|
+
echo Checking for new CSV files in local storage...
|
43
|
+
for %%f in ("%local_storage_path%\*.csv") do (
|
44
|
+
echo Moving %%f to %source_folder%...
|
45
|
+
move "%%f" "%source_folder%"
|
46
|
+
)
|
47
|
+
)
|
48
|
+
|
49
|
+
:: Timestamp for new filename
|
50
|
+
for /f "tokens=1-5 delims=/: " %%a in ('echo %time%') do (
|
51
|
+
set "hour=%%a"
|
52
|
+
set "minute=%%b"
|
53
|
+
set "second=%%c"
|
54
|
+
)
|
55
|
+
for /f "tokens=2-4 delims=/ " %%a in ('echo %date%') do (
|
56
|
+
set "day=%%a"
|
57
|
+
set "month=%%b"
|
58
|
+
set "year=%%c"
|
59
|
+
)
|
60
|
+
set "timestamp=!year!!month!!day!_!hour!!minute!"
|
61
|
+
|
62
|
+
:: Find most recent CSV in source folder
|
63
|
+
set "latest_csv="
|
64
|
+
for /f "delims=" %%a in ('dir /b /a-d /o-d "%source_folder%\*.csv"') do (
|
65
|
+
set "latest_csv=%%a"
|
66
|
+
goto :have_csv
|
67
|
+
)
|
68
|
+
echo No CSV files found in %source_folder%.
|
69
|
+
set /p _="Press Enter to continue..."
|
70
|
+
exit /b 0
|
71
|
+
|
72
|
+
:have_csv
|
73
|
+
echo Validating latest CSV with config file...
|
74
|
+
if exist "%python_script%" if exist "%config_file%" (
|
75
|
+
for /f "delims=" %%a in ('python "%python_script%" "%config_file%"') do set "current_csv=%%a"
|
76
|
+
for %%f in ("!current_csv!") do set "current_csv_name=%%~nxf"
|
77
|
+
for %%f in ("%target_folder%\!latest_csv!") do set "latest_csv_name=%%~nxf"
|
78
|
+
if not "!current_csv_name!"=="!latest_csv_name!" (
|
79
|
+
echo Current CSV: !current_csv_name!
|
80
|
+
echo Latest CSV: !latest_csv_name!
|
81
|
+
set /p update_choice="Update config to latest CSV? (Y/N): "
|
82
|
+
if /i "!update_choice!"=="Y" (
|
83
|
+
python "%python_script%" "%config_file%" "%target_folder%\!latest_csv!"
|
84
|
+
)
|
85
|
+
)
|
86
|
+
)
|
87
|
+
|
88
|
+
move "%source_folder%\!latest_csv!" "%target_folder%\SX_CSV_!timestamp!.csv"
|
89
|
+
set "new_csv_path=%target_folder%\SX_CSV_!timestamp!.csv"
|
90
|
+
echo Processing CSV...
|
91
|
+
if exist "%python_script%" if exist "%config_file%" (
|
92
|
+
python "%python_script%" "%config_file%" "!new_csv_path!"
|
93
|
+
)
|
94
|
+
echo CSV Processor Complete.
|
95
|
+
set /p _="Press Enter to continue..."
|
96
|
+
exit /b 0
|
97
|
+
|
98
|
+
|
MediBot/update_medicafe.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Script Version: 2.0.2 (clean 3-try updater)
|
4
4
|
# Target environment: Windows XP SP3 + Python 3.4.4 (ASCII-only)
|
5
5
|
|
6
|
-
import sys, os, time, subprocess, platform
|
6
|
+
import sys, os, time, subprocess, platform, threading
|
7
7
|
|
8
8
|
try:
|
9
9
|
import requests
|
@@ -151,10 +151,96 @@ def check_internet_connection():
|
|
151
151
|
|
152
152
|
|
153
153
|
# ---------- Upgrade logic (3 attempts, minimal delays) ----------
|
154
|
+
def _should_show_pip_line(text_line):
|
155
|
+
try:
|
156
|
+
# Show only useful progress lines to avoid noisy output
|
157
|
+
line = text_line.strip().lower()
|
158
|
+
keywords = [
|
159
|
+
'collecting', 'downloading', 'installing', 'building',
|
160
|
+
'successfully installed', 'successfully built',
|
161
|
+
'requirement already satisfied', 'uninstalling', 'preparing',
|
162
|
+
'error', 'warning'
|
163
|
+
]
|
164
|
+
for kw in keywords:
|
165
|
+
if kw in line:
|
166
|
+
return True
|
167
|
+
except Exception:
|
168
|
+
pass
|
169
|
+
return False
|
170
|
+
|
171
|
+
|
172
|
+
def _start_heartbeat(label):
|
173
|
+
# Prints a simple heartbeat every 10 seconds while a subprocess runs
|
174
|
+
stop_event = threading.Event()
|
175
|
+
start_ts = time.time()
|
176
|
+
|
177
|
+
def _runner():
|
178
|
+
last_emitted = -1
|
179
|
+
while not stop_event.is_set():
|
180
|
+
try:
|
181
|
+
elapsed = int(time.time() - start_ts)
|
182
|
+
if elapsed >= 10 and elapsed // 10 != last_emitted:
|
183
|
+
last_emitted = elapsed // 10
|
184
|
+
print_status('INFO', '{}... {}s elapsed'.format(label, elapsed))
|
185
|
+
try:
|
186
|
+
sys.stdout.flush()
|
187
|
+
except Exception:
|
188
|
+
pass
|
189
|
+
except Exception:
|
190
|
+
# Never fail due to heartbeat issues
|
191
|
+
pass
|
192
|
+
time.sleep(1)
|
193
|
+
|
194
|
+
t = threading.Thread(target=_runner)
|
195
|
+
t.daemon = True
|
196
|
+
t.start()
|
197
|
+
return stop_event
|
198
|
+
|
199
|
+
|
154
200
|
def run_pip_install(args):
|
155
|
-
|
156
|
-
|
157
|
-
|
201
|
+
# Stream stdout live (stderr merged) with periodic heartbeat
|
202
|
+
try:
|
203
|
+
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
204
|
+
except Exception:
|
205
|
+
# Fallback to legacy behavior if streaming spawn fails for any reason
|
206
|
+
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
207
|
+
out, err = proc.communicate()
|
208
|
+
try:
|
209
|
+
return proc.returncode, out.decode(errors='ignore'), err.decode(errors='ignore')
|
210
|
+
except Exception:
|
211
|
+
return proc.returncode, '', ''
|
212
|
+
|
213
|
+
heartbeat = _start_heartbeat('Installer running')
|
214
|
+
out_lines = []
|
215
|
+
try:
|
216
|
+
while True:
|
217
|
+
chunk = proc.stdout.readline()
|
218
|
+
if not chunk:
|
219
|
+
if proc.poll() is not None:
|
220
|
+
break
|
221
|
+
# Small sleep to avoid tight loop if no data
|
222
|
+
time.sleep(0.1)
|
223
|
+
continue
|
224
|
+
try:
|
225
|
+
text = chunk.decode(errors='ignore').replace('\r', '')
|
226
|
+
except Exception:
|
227
|
+
text = ''
|
228
|
+
out_lines.append(text)
|
229
|
+
if _should_show_pip_line(text):
|
230
|
+
try:
|
231
|
+
# Print selected progress lines immediately
|
232
|
+
print(text.strip())
|
233
|
+
sys.stdout.flush()
|
234
|
+
except Exception:
|
235
|
+
pass
|
236
|
+
finally:
|
237
|
+
try:
|
238
|
+
heartbeat.set()
|
239
|
+
except Exception:
|
240
|
+
pass
|
241
|
+
|
242
|
+
# With stderr merged into stdout, return empty err string
|
243
|
+
return proc.returncode, ''.join(out_lines), ''
|
158
244
|
|
159
245
|
|
160
246
|
def verify_post_install(package, expected_version):
|
@@ -208,9 +294,17 @@ def upgrade_package(package):
|
|
208
294
|
print_status('WARNING', 'Install returned success but version not updated yet{}'.format(
|
209
295
|
'' if not installed else ' (detected {})'.format(installed)))
|
210
296
|
else:
|
211
|
-
# Show error output concisely
|
297
|
+
# Show error output concisely; if stderr empty (merged), show tail of stdout
|
212
298
|
if err:
|
213
299
|
print(err.strip())
|
300
|
+
elif out:
|
301
|
+
try:
|
302
|
+
lines = out.strip().splitlines()
|
303
|
+
tail = '\n'.join(lines[-15:])
|
304
|
+
if tail:
|
305
|
+
print(tail)
|
306
|
+
except Exception:
|
307
|
+
pass
|
214
308
|
# Detect extras error and fall back to non-binary package
|
215
309
|
if 'Invalid requirement' in err or 'extras' in err or '[binary]' in err:
|
216
310
|
print_status('INFO', 'Falling back to installing without [binary] extra')
|
@@ -223,6 +317,14 @@ def upgrade_package(package):
|
|
223
317
|
return True
|
224
318
|
if err2:
|
225
319
|
print(err2.strip())
|
320
|
+
elif out2:
|
321
|
+
try:
|
322
|
+
lines2 = out2.strip().splitlines()
|
323
|
+
tail2 = '\n'.join(lines2[-15:])
|
324
|
+
if tail2:
|
325
|
+
print(tail2)
|
326
|
+
except Exception:
|
327
|
+
pass
|
226
328
|
print_status('WARNING', 'pip returned non-zero exit code ({})'.format(code))
|
227
329
|
|
228
330
|
return False
|
MediCafe/__init__.py
CHANGED
MediLink/__init__.py
CHANGED
@@ -8,14 +8,20 @@ MediBot/MediBot_Preprocessor.py,sha256=gQRVAWbRHx_PMK6a7q93tp7Z-Dhjn5r0lJz3d0wAz
|
|
8
8
|
MediBot/MediBot_Preprocessor_lib.py,sha256=lyl2Q5V1MQHiZ54kmTYPxor3pm2gf8mAq-IwYu7FX2c,87236
|
9
9
|
MediBot/MediBot_UI.py,sha256=iG8UK71aHYBmB0lkjwl-C6L9DbsOyLaq-wt9kChV0jo,23781
|
10
10
|
MediBot/MediBot_dataformat_library.py,sha256=D46fdPtxcgfWTzaLBtSvjtozzZBNqNiODgu4vKMZrBg,10746
|
11
|
+
MediBot/MediBot_debug.bat,sha256=F5Lfi3nFEEo4Ddx9EbX94u3fNAMgzMp3wsn-ULyASTM,6017
|
11
12
|
MediBot/MediBot_docx_decoder.py,sha256=gn7I7Ng5khVIzU0HTTOqi31YSSn1yW8Pyk-i_P9r1oA,32472
|
12
13
|
MediBot/MediBot_smart_import.py,sha256=Emvz7NwemHGCHvG5kZcUyXMcCheidbGKaPfOTg-YCEs,6684
|
13
|
-
MediBot/__init__.py,sha256=
|
14
|
+
MediBot/__init__.py,sha256=yURSfXM6lBhQ71vcPdDzF4De-ARpvtSUwNDg9yxJfwA,3192
|
15
|
+
MediBot/clear_cache.bat,sha256=F6-VhETWw6xDdGWG2wUqvtXjCl3lY4sSUFqF90bM8-8,1860
|
16
|
+
MediBot/crash_diagnostic.bat,sha256=j8kUtyBg6NOWbXpeFuEqIRHOkVzgUrLOqO3FBMfNxTo,9268
|
17
|
+
MediBot/f_drive_diagnostic.bat,sha256=4572hZaiwZ5wVAarPcZJQxkOSTwAdDuT_X914noARak,6878
|
18
|
+
MediBot/full_debug_suite.bat,sha256=b3Euz-VbRaPE6tWmgpjApfv4_cB5-Rk8BLNlLrp2bpo,2223
|
14
19
|
MediBot/get_medicafe_version.py,sha256=uyL_UIE42MyFuJ3SRYxJp8sZx8xjTqlYZ3FdQuxLduY,728
|
20
|
+
MediBot/process_csvs.bat,sha256=4PnwLyLRqwZ_rIsd6MvtwOI21MDKKm4HMzNgFwvpPG0,3339
|
15
21
|
MediBot/update_json.py,sha256=vvUF4mKCuaVly8MmoadDO59M231fCIInc0KI1EtDtPA,3704
|
16
|
-
MediBot/update_medicafe.py,sha256=
|
22
|
+
MediBot/update_medicafe.py,sha256=J5ktFGq6gTsov0NCrMhq3nmyiiIsUqnH28LoeDWg-hg,16072
|
17
23
|
MediCafe/MediLink_ConfigLoader.py,sha256=fNBFnPbh1YRVCs9WvZp6tPsKTUFzK3f38ePeUQ00QrQ,10161
|
18
|
-
MediCafe/__init__.py,sha256=
|
24
|
+
MediCafe/__init__.py,sha256=5QEV5QGG7yL9V3s-T41mPO7sW5kdCRpP-oV3Zrvr0nI,5721
|
19
25
|
MediCafe/__main__.py,sha256=mRNyk3D9Ilnu2XhgVI_rut7r5Ro7UIKtwV871giAHI8,12992
|
20
26
|
MediCafe/api_core.py,sha256=IZaBXnP4E7eHzxVbCk2HtxywiVBuhaUyHeaqss8llgY,66378
|
21
27
|
MediCafe/api_core_backup.py,sha256=Oy_Fqt0SEvGkQN1Oqw5iUPVFxPEokyju5CuPEb9k0OY,18686
|
@@ -54,7 +60,7 @@ MediLink/MediLink_insurance_utils.py,sha256=g741Fj2K26cMy0JX5d_XavMw9LgkK6hjaUJY
|
|
54
60
|
MediLink/MediLink_main.py,sha256=ZVK2UsgSxC9UqgIYfgVu95ugULcH6-11l67jsf4vdJc,22132
|
55
61
|
MediLink/MediLink_smart_import.py,sha256=B5SfBn_4bYEWJJDolXbjnwKx_-MaqGZ76LyXQwWDV80,9838
|
56
62
|
MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
|
57
|
-
MediLink/__init__.py,sha256=
|
63
|
+
MediLink/__init__.py,sha256=plqDrDmWDN3N6xu88AfycAkCIstaG2l2d2hQZy5OmCc,3888
|
58
64
|
MediLink/gmail_http_utils.py,sha256=gtqCCrzJC7e8JFQzMNrf7EbK8na2h4sfTu-NMaZ_UHc,4006
|
59
65
|
MediLink/gmail_oauth_utils.py,sha256=Ugr-DEqs4_RddRMSCJ_dbgA3TVeaxpbAor-dktcTIgY,3713
|
60
66
|
MediLink/insurance_type_integration_test.py,sha256=pz2OCXitAznqDciYn6OL9M326m9CYU7YiK-ynssdQ5g,15172
|
@@ -64,9 +70,9 @@ MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,
|
|
64
70
|
MediLink/test_timing.py,sha256=yH2b8QPLDlp1Zy5AhgtjzjnDHNGhAD16ZtXtZzzESZw,2042
|
65
71
|
MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
|
66
72
|
MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
|
67
|
-
medicafe-0.250820.
|
68
|
-
medicafe-0.250820.
|
69
|
-
medicafe-0.250820.
|
70
|
-
medicafe-0.250820.
|
71
|
-
medicafe-0.250820.
|
72
|
-
medicafe-0.250820.
|
73
|
+
medicafe-0.250820.5.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
74
|
+
medicafe-0.250820.5.dist-info/METADATA,sha256=HBTsfYTGvop_lwZSC-YNtzR60McqMVXeeF66xddklQY,3414
|
75
|
+
medicafe-0.250820.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
76
|
+
medicafe-0.250820.5.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
|
77
|
+
medicafe-0.250820.5.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
|
78
|
+
medicafe-0.250820.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|