]>
crepu.dev Git - config.git/blob - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/jedi/plugins/flask.py
1 def import_module(callback
):
3 Handle "magic" Flask extension imports:
4 ``flask.ext.foo`` is really ``flask_foo`` or ``flaskext.foo``.
6 def wrapper(inference_state
, import_names
, module_context
, *args
, **kwargs
):
7 if len(import_names
) == 3 and import_names
[:2] == ('flask', 'ext'):
9 ipath
= ('flask_' + import_names
[2]),
10 value_set
= callback(inference_state
, ipath
, None, *args
, **kwargs
)
13 value_set
= callback(inference_state
, ('flaskext',), None, *args
, **kwargs
)
16 ('flaskext', import_names
[2]),
17 next(iter(value_set
)),
20 return callback(inference_state
, import_names
, module_context
, *args
, **kwargs
)