iris-pex-embedded-python 3.7.1b2__py3-none-any.whl → 3.7.1b4__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.
iop/_dispatch.py CHANGED
@@ -116,13 +116,25 @@ def create_dispatch(host: Any) -> None:
116
116
  The dispatch table consists of tuples of (fully_qualified_class_name, method_name).
117
117
  Only methods that take a single typed parameter are considered as handlers.
118
118
  """
119
- if len(host.DISPATCH) > 0:
120
- return
119
+ dispatch = _declared_dispatch(host)
121
120
 
122
121
  for method_name in get_callable_methods(host):
123
122
  handler_info = get_handler_info(host, method_name)
124
- if handler_info:
125
- host.DISPATCH.append(handler_info)
123
+ if handler_info and handler_info not in dispatch:
124
+ dispatch.append(handler_info)
125
+
126
+ host.DISPATCH = dispatch
127
+
128
+
129
+ def _declared_dispatch(host: Any) -> List[Tuple[str, str]]:
130
+ if "DISPATCH" in getattr(host, "__dict__", {}):
131
+ return list(host.__dict__["DISPATCH"])
132
+
133
+ class_dispatch = host.__class__.__dict__.get("DISPATCH")
134
+ if class_dispatch is not None:
135
+ return list(class_dispatch)
136
+
137
+ return []
126
138
 
127
139
 
128
140
  def get_callable_methods(host: Any) -> List[str]:
@@ -299,8 +299,10 @@ def load_python_class(
299
299
  except ModuleNotFoundError as exc:
300
300
  if not python_classpath or not _is_missing_target_module(exc, module_name):
301
301
  raise
302
- _prepend_sys_path(python_classpath)
303
- module = importlib.import_module(module_name)
302
+ module = _import_module_from_classpath(module_name, python_classpath)
303
+ else:
304
+ if python_classpath and not hasattr(module, class_name):
305
+ module = _import_module_from_classpath(module_name, python_classpath)
304
306
  return getattr(module, class_name)
305
307
 
306
308
 
@@ -529,3 +531,10 @@ def _prepend_sys_path(path: str) -> None:
529
531
  while normalized_path in sys.path:
530
532
  sys.path.remove(normalized_path)
531
533
  sys.path.insert(0, normalized_path)
534
+ importlib.invalidate_caches()
535
+
536
+
537
+ def _import_module_from_classpath(module_name: str, python_classpath: str):
538
+ _prepend_sys_path(python_classpath)
539
+ sys.modules.pop(module_name, None)
540
+ return importlib.import_module(module_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.7.1b2
3
+ Version: 3.7.1b4
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License
@@ -40,7 +40,7 @@ iop/_debugpy.py,sha256=0UOLkOjXkJ24GxxyEnPckafrAtfVVUDYIedmLIznYfM,6067
40
40
  iop/_decorators.py,sha256=2UFV56sfopuBqgxTTj71XgAAwoQm1ijDi_3N-GIKbu8,2337
41
41
  iop/_director.py,sha256=dN_SGyUDPH19kUt7_AR6vBrDlKUg0RRgYVkvJFjsYOM,11855
42
42
  iop/_director_protocol.py,sha256=w190gB6hxXJjiB--ll5bzeLsZkL-SK9VzYLGQ1WpUbA,2797
43
- iop/_dispatch.py,sha256=dc7cyfcIH7KLGwFL_nKWKdGKQBRS_dlrlwnBtvxZT9c,5055
43
+ iop/_dispatch.py,sha256=scCDwpfHyaUcYcXL3VSZX_vVFUz_Jl2VzVC5Q7ONURU,5416
44
44
  iop/_generator_request.py,sha256=2No4E2mjBr7bPwBljsKbWX3QxTrjgdyz683tynlg-OI,1339
45
45
  iop/_inbound_adapter.py,sha256=WErDcXzHhYNN0QanmTay34Zh_uUxlEykJ4YmevTVOyY,1654
46
46
  iop/_iris.py,sha256=Zc4IvMv3us3rrBNCba1AU8RSXvct2wZkCZVSWN84c-k,198
@@ -49,7 +49,7 @@ iop/_log_manager.py,sha256=Egrul1LCQlYrvIgcoF-LjXoeXaLLh_nD9bB4P-Y-q_E,3225
49
49
  iop/_message.py,sha256=fTHxYHBq42QIDGrtVuw-7NJAQ7bLIWPdbl5EmwiDhG0,1465
50
50
  iop/_message_validator.py,sha256=XzQ4qkHLYoai2_gPk3ItXHVgwz2WldiBcNE32yaxOVc,1540
51
51
  iop/_outbound_adapter.py,sha256=GSsr6z0gvVygNyr3YicHBt7i2ZJu3wJgrCpPqod7Z_U,732
52
- iop/_persistent_message.py,sha256=Y_L8G2GEVNJVEaRTiJnhg6cdC808J2A8p_Hnm-qRKcc,16715
52
+ iop/_persistent_message.py,sha256=8uV_mmC82N8sOIx_R-oQ8hLL9T2nms1rGEBoAzteC24,17091
53
53
  iop/_private_session_duplex.py,sha256=SLqwnB4gLKqCt-DClIEFg_yWcQs16A4Va7lRyUg-18o,5289
54
54
  iop/_private_session_process.py,sha256=J1HjRIphg0iHHEIa6Rqa68vA22ODMN6BfNqAN4Ybi1U,1723
55
55
  iop/_remote.py,sha256=zE4eZtNuqQemtX2gBwu59n56ixBtwkV25GvZgqVKlMU,17395
@@ -86,9 +86,9 @@ iop/cls/IOP/Service/WSGI.cls,sha256=VLNCXEwmHW9dBnE51uGE1nvGX6T4HjhqePT3LVhsjAE,
86
86
  iop/cls/IOP/Service/Remote/Handler.cls,sha256=JfsXse2jvoVvQfW8_rVEt2DCQJ9SVqReCcOUngOkpzE,938
87
87
  iop/cls/IOP/Service/Remote/Rest/v1.cls,sha256=DRaYNsbFmczdVltb-HMZvviy5EcjcJx7__zmnKANNm8,14429
88
88
  iop/wsgi/handlers.py,sha256=lcCZ1ixnYqdo9eNrBSsQbhS9ei2x11p9e4SHHb__zmY,2951
89
- iris_pex_embedded_python-3.7.1b2.dist-info/licenses/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
90
- iris_pex_embedded_python-3.7.1b2.dist-info/METADATA,sha256=4ry7yiiKBoYY9JLm6VWDIWOFlXgHhL_aCmJkxeFeIMU,4310
91
- iris_pex_embedded_python-3.7.1b2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
92
- iris_pex_embedded_python-3.7.1b2.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
93
- iris_pex_embedded_python-3.7.1b2.dist-info/top_level.txt,sha256=4p0q6hCATmYIVMVi3I8hOUcJE1kwzyBeHygWv_rGvrU,13
94
- iris_pex_embedded_python-3.7.1b2.dist-info/RECORD,,
89
+ iris_pex_embedded_python-3.7.1b4.dist-info/licenses/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
90
+ iris_pex_embedded_python-3.7.1b4.dist-info/METADATA,sha256=oltFiMnUbk0TPH-LywlYB41pWOJX-A3x2ySt1kX2W_o,4310
91
+ iris_pex_embedded_python-3.7.1b4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
92
+ iris_pex_embedded_python-3.7.1b4.dist-info/entry_points.txt,sha256=pj-i4LSDyiSP6xpHlVjMCbg1Pik7dC3_sdGY3Yp9Vhk,38
93
+ iris_pex_embedded_python-3.7.1b4.dist-info/top_level.txt,sha256=4p0q6hCATmYIVMVi3I8hOUcJE1kwzyBeHygWv_rGvrU,13
94
+ iris_pex_embedded_python-3.7.1b4.dist-info/RECORD,,