Coverage for src / mafw / plugins.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-09 09:08 +0000

1# Copyright 2025 European Union 

2# Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu) 

3# SPDX-License-Identifier: EUPL-1.2 

4""" 

5Exports Processor classes to the execution script. 

6""" 

7 

8from typing import List 

9 

10from mafw import mafw_hookimpl 

11from mafw.lazy_import import ( 

12 LazyImportProcessor, 

13 LazyImportUserInterface, 

14 ProcessorClassProtocol, 

15 UserInterfaceClassProtocol, 

16) 

17 

18 

19@mafw_hookimpl 

20def register_processors() -> List[ProcessorClassProtocol]: 

21 """Returns a list of processors to be registered""" 

22 return [ 

23 LazyImportProcessor('mafw.examples.sum_processor', 'AccumulatorProcessor'), 

24 LazyImportProcessor('mafw.examples.sum_processor', 'GaussAdder'), 

25 LazyImportProcessor('mafw.examples.loop_modifier', 'ModifyLoopProcessor'), 

26 LazyImportProcessor('mafw.examples.db_processors', 'CountStandardTables'), 

27 LazyImportProcessor('mafw.examples.db_processors', 'FillFileTableProcessor'), 

28 LazyImportProcessor('mafw.examples.loop_modifier', 'FindNPrimeNumber'), 

29 LazyImportProcessor('mafw.examples.loop_modifier', 'FindPrimeNumberInRange'), 

30 LazyImportProcessor('mafw.examples.importer_example', 'ImporterExample'), 

31 LazyImportProcessor('mafw.processor_library.db_init', 'TableCreator'), 

32 LazyImportProcessor('mafw.processor_library.db_init', 'TriggerRefresher'), 

33 LazyImportProcessor('mafw.processor_library.db_init', 'SQLScriptRunner'), 

34 ] 

35 

36 

37@mafw_hookimpl 

38def register_user_interfaces() -> List[UserInterfaceClassProtocol]: 

39 """Returns a list of user interfaces that can be used""" 

40 return [ 

41 LazyImportUserInterface('mafw.ui.rich_user_interface', 'RichInterface', 'rich'), 

42 LazyImportUserInterface('mafw.ui.console_user_interface', 'ConsoleInterface', 'console'), 

43 ] 

44 

45 

46@mafw_hookimpl 

47def register_db_model_modules() -> List[str]: 

48 """Returns the list of modules with the database model definitions""" 

49 return []