Coverage for /home/runner/work/viur-core/viur-core/viur/src/viur/core/prototypes/__init__.py: 0%

18 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-03 13:41 +0000

1from .list import List 

2from .singleton import Singleton 

3from .tree import Tree, TreeSkel 

4 

5 

6# DEPRECATED ATTRIBUTES HANDLING 

7def __getattr__(attr): 

8 if attr in ("BasicApplication", ): 

9 ret = None 

10 

11 match attr: 

12 case "BasicApplication": 

13 msg = f"The use of `prototypes.BasicApplication` is deprecated; " \ 

14 f"Please use `viur.core.prototypes.skelmodule.SkelModule` instead!" 

15 from viur.core.prototypes.skelmodule import SkelModule 

16 ret = SkelModule 

17 

18 if ret: 

19 import warnings 

20 import logging 

21 warnings.warn(msg, DeprecationWarning, stacklevel=3) 

22 logging.warning(msg, stacklevel=3) 

23 return ret 

24 

25 return super(__import__(__name__).__class__).__getattr__(attr)