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

11 statements  

« prev     ^ index     » next       coverage.py v7.15.0, created at 2026-07-26 09:13 +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 mafw import mafw_hookimpl 

9from mafw.lazy_import import ( 

10 LazyImportProcessor, 

11 LazyImportUserInterface, 

12 ProcessorClassProtocol, 

13 UserInterfaceClassProtocol, 

14) 

15 

16 

17@mafw_hookimpl 

18def register_processors() -> list[ProcessorClassProtocol]: 

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

20 return [ 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

35 ] 

36 

37 

38@mafw_hookimpl 

39def register_user_interfaces() -> list[UserInterfaceClassProtocol]: 

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

41 return [ 

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

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

44 ] 

45 

46 

47@mafw_hookimpl 

48def register_db_model_modules() -> list[str]: 

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

50 return []