medicafe 0.250725.2__py3-none-any.whl → 0.250725.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.

Potentially problematic release.


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

MediBot/MediBot.py CHANGED
@@ -1,5 +1,5 @@
1
1
  #MediBot.py
2
- import subprocess, os, tempfile, traceback, re, sys, time, msvcrt
2
+ import subprocess, os, tempfile, traceback, re, sys, time, msvcrt, ctypes
3
3
  from collections import OrderedDict
4
4
  import MediBot_dataformat_library
5
5
  import MediBot_Preprocessor
@@ -12,6 +12,36 @@ sys.path.append(project_dir)
12
12
 
13
13
  from MediLink import MediLink_ConfigLoader
14
14
 
15
+ def flush_console_input_buffer():
16
+ """
17
+ Remove any keystrokes already sitting in the console input buffer.
18
+ Necessary on Windows XP where a stray CR/LF can remain after the
19
+ script is launched.
20
+ """
21
+ if sys.platform != "win32":
22
+ return # no-op on non-Windows
23
+
24
+ try:
25
+ kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
26
+ STD_INPUT_HANDLE = -10
27
+ h_stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
28
+ kernel32.FlushConsoleInputBuffer(h_stdin)
29
+ except Exception:
30
+ # Fallback: drain any leading newlines manually
31
+ while msvcrt.kbhit():
32
+ msvcrt.getch()
33
+
34
+ def discard_leading_blank():
35
+ """
36
+ Alternative fallback that uses non-blocking msvcrt to drain any available input.
37
+ """
38
+ if sys.platform != "win32":
39
+ return # no-op on non-Windows
40
+
41
+ # Use non-blocking msvcrt approach to drain any available input
42
+ while msvcrt.kbhit():
43
+ msvcrt.getch()
44
+
15
45
  try:
16
46
  from MediBot_Crosswalk_Library import crosswalk_update
17
47
  except ImportError:
@@ -400,9 +430,8 @@ if __name__ == "__main__":
400
430
  sys.stdout.flush()
401
431
  time.sleep(0.2) # Increased delay for Windows XP
402
432
 
403
- # Clear any leftover input in stdin buffer for Windows XP compatibility
404
- while msvcrt.kbhit():
405
- msvcrt.getch()
433
+ # Flush console input buffer to remove any stray CR/LF
434
+ flush_console_input_buffer()
406
435
 
407
436
  # Use sys.stdin.readline() for more reliable input on Windows XP
408
437
  proceed = sys.stdin.readline().lower().strip() in ['yes', 'y']
@@ -412,9 +441,8 @@ if __name__ == "__main__":
412
441
  sys.stdout.flush()
413
442
  time.sleep(0.2) # Increased delay for Windows XP
414
443
 
415
- # Clear any leftover input in stdin buffer for Windows XP compatibility
416
- while msvcrt.kbhit():
417
- msvcrt.getch()
444
+ # Flush console input buffer to remove any stray CR/LF
445
+ flush_console_input_buffer()
418
446
 
419
447
  # Use sys.stdin.readline() for more reliable input on Windows XP
420
448
  proceed = sys.stdin.readline().lower().strip() in ['yes', 'y']
MediBot/MediBot_UI.py CHANGED
@@ -18,6 +18,36 @@ config, crosswalk = MediLink_ConfigLoader.load_configuration()
18
18
  VK_END = int(config.get('VK_END', ""), 16) # Try F12 (7B). Virtual key code for 'End' (23)
19
19
  VK_PAUSE = int(config.get('VK_PAUSE', ""), 16) # Try F11 (7A). Virtual-key code for 'Home' (24)
20
20
 
21
+ def flush_console_input_buffer():
22
+ """
23
+ Remove any keystrokes already sitting in the console input buffer.
24
+ Necessary on Windows XP where a stray CR/LF can remain after the
25
+ script is launched.
26
+ """
27
+ if sys.platform != "win32":
28
+ return # no-op on non-Windows
29
+
30
+ try:
31
+ kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
32
+ STD_INPUT_HANDLE = -10
33
+ h_stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
34
+ kernel32.FlushConsoleInputBuffer(h_stdin)
35
+ except Exception:
36
+ # Fallback: drain any leading newlines manually
37
+ while msvcrt.kbhit():
38
+ msvcrt.getch()
39
+
40
+ def discard_leading_blank():
41
+ """
42
+ Alternative fallback that uses non-blocking msvcrt to drain any available input.
43
+ """
44
+ if sys.platform != "win32":
45
+ return # no-op on non-Windows
46
+
47
+ # Use non-blocking msvcrt approach to drain any available input
48
+ while msvcrt.kbhit():
49
+ msvcrt.getch()
50
+
21
51
  class AppControl:
22
52
  def __init__(self):
23
53
  self.script_paused = False
@@ -152,9 +182,8 @@ def display_patient_selection_menu(csv_data, reverse_mapping, proceed_as_medicar
152
182
  sys.stdout.flush()
153
183
  time.sleep(0.2) # Increased delay for Windows XP
154
184
 
155
- # Clear any leftover input in stdin buffer for Windows XP compatibility
156
- while msvcrt.kbhit():
157
- msvcrt.getch()
185
+ # Flush console input buffer to remove any stray CR/LF
186
+ flush_console_input_buffer()
158
187
 
159
188
  # Use sys.stdin.readline() for more reliable input on Windows XP
160
189
  proceed = sys.stdin.readline().lower().strip() in ['yes', 'y']
@@ -171,9 +200,8 @@ def display_patient_selection_menu(csv_data, reverse_mapping, proceed_as_medicar
171
200
  sys.stdout.flush()
172
201
  time.sleep(0.2) # Increased delay for Windows XP
173
202
 
174
- # Clear any leftover input in stdin buffer for Windows XP compatibility
175
- while msvcrt.kbhit():
176
- msvcrt.getch()
203
+ # Flush console input buffer to remove any stray CR/LF
204
+ flush_console_input_buffer()
177
205
 
178
206
  # Use sys.stdin.readline() for more reliable input on Windows XP
179
207
  selection = sys.stdin.readline().strip()
@@ -255,9 +283,8 @@ def handle_user_interaction(interaction_mode, error_message):
255
283
  sys.stdout.flush()
256
284
  time.sleep(0.2) # Increased delay for Windows XP
257
285
 
258
- # Clear any leftover input in stdin buffer for Windows XP compatibility
259
- while msvcrt.kbhit():
260
- msvcrt.getch()
286
+ # Flush console input buffer to remove any stray CR/LF
287
+ flush_console_input_buffer()
261
288
 
262
289
  # Use sys.stdin.readline() for more reliable input on Windows XP
263
290
  choice = sys.stdin.readline().strip()
@@ -289,6 +316,9 @@ def user_interaction(csv_data, interaction_mode, error_message, reverse_mapping)
289
316
 
290
317
  # Force flush for Windows XP compatibility
291
318
  sys.stdout.flush()
319
+
320
+ # Flush console input buffer to remove any stray CR/LF from script launch
321
+ flush_console_input_buffer()
292
322
 
293
323
  while True:
294
324
  try:
@@ -298,10 +328,6 @@ def user_interaction(csv_data, interaction_mode, error_message, reverse_mapping)
298
328
  sys.stdout.flush()
299
329
  time.sleep(0.2) # Increased delay for Windows XP
300
330
 
301
- # Clear any leftover input in stdin buffer for Windows XP compatibility
302
- while msvcrt.kbhit():
303
- msvcrt.getch()
304
-
305
331
  # Use sys.stdin.readline() for more reliable input on Windows XP
306
332
  response = sys.stdin.readline().lower().strip()
307
333
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250725.2
3
+ Version: 0.250725.5
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,11 +1,11 @@
1
1
  MediBot/MediBot.bat,sha256=anz5i-Td1k3HhRUvkCqHsw9lBLVmO6q9bt5kLTfr1Iw,13282
2
- MediBot/MediBot.py,sha256=aHpRdCWiGjqAMR-8PQo0XdkanP5CGcrTp-CMr4aYShA,25265
2
+ MediBot/MediBot.py,sha256=UOwqSRrirEqWG5odjIX8jglGM_thAD7IuPu8IhJ8Dao,26215
3
3
  MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  MediBot/MediBot_Crosswalk_Library.py,sha256=Ix4QlAcg3O9Y6n6ZeSUtbmtV-_n-t0-jnefXDBFlhhI,51441
5
5
  MediBot/MediBot_Post.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  MediBot/MediBot_Preprocessor.py,sha256=Lc9uQnE5SAa0dQTOREdPV1QUB2cywXTHJ1h2w-fyeeQ,13331
7
7
  MediBot/MediBot_Preprocessor_lib.py,sha256=LXzV85uq7YoAWbZi88HzAs_GObl7vP8mhFbWZQbd0M8,45687
8
- MediBot/MediBot_UI.py,sha256=0gDkjnNKnvfW0ta1otkAUjFhtjhY-MTwsop33AljSoc,14869
8
+ MediBot/MediBot_UI.py,sha256=MMjq6CQkxOOmqLPdki3V9wYWGN2bFxhh5niO6G23YhQ,15734
9
9
  MediBot/MediBot_dataformat_library.py,sha256=XNyeiOC6uJUp15UXP_rhtB3rMTPus9ZXDnz5zHNoRYM,8586
10
10
  MediBot/MediBot_docx_decoder.py,sha256=GbhX58pMAsWNhBF7B8AtWiNpUOB4bU0zAM81moXYkkE,27370
11
11
  MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
@@ -49,8 +49,8 @@ MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
49
49
  MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,13841
50
50
  MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
51
51
  MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
52
- medicafe-0.250725.2.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
53
- medicafe-0.250725.2.dist-info/METADATA,sha256=eY5ix4d_FdtWuR3IJW7nA0QefOQXa3-vJjH8K3c9Yeo,5501
54
- medicafe-0.250725.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
55
- medicafe-0.250725.2.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
56
- medicafe-0.250725.2.dist-info/RECORD,,
52
+ medicafe-0.250725.5.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
53
+ medicafe-0.250725.5.dist-info/METADATA,sha256=nxo_ri1sqVpnGCke2lXjjP2wW7Os9BzhJAktiZT2Weo,5501
54
+ medicafe-0.250725.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
55
+ medicafe-0.250725.5.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
56
+ medicafe-0.250725.5.dist-info/RECORD,,