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

12 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-30 16:10 +0000

1# Copyright 2025–2026 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.loop_modifier', 'FindPrimeNumberInRangeParallel'), 

31 LazyImportProcessor('mafw.examples.loop_modifier', 'FindPrimeNumberInRangeParallelWithQueue'), 

32 LazyImportProcessor('mafw.examples.loop_modifier', 'FindPrimeNumberInRangeTunable'), 

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

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

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

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

37 ] 

38 

39 

40@mafw_hookimpl 

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

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

43 return [ 

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

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

46 ] 

47 

48 

49@mafw_hookimpl 

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

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

52 return []