<commit_before>from pydispatch import dispatcher

import cbpos
from cbpos.modules import BaseModuleLoader

class ModuleLoader(BaseModuleLoader):
    def load_models(self):
        from cbmod.base.models import StoredFile
        return [StoredFile]

    def init(self):
        from cbmod.base.controllers import printing
        
        printing.manager = printing.PrinterManager()
        
        dispatcher.connect(cbpos.terminate, signal='exit', sender=dispatcher.Any)
        dispatcher.connect(printing.manager.register_function, signal='printing-register-function', sender=dispatcher.Any)
        dispatcher.connect(printing.manager.handle, signal='printing-handle', sender=dispatcher.Any)
        
        return True

    def ui_handler(self):
        from cbmod.base.ui import QtUIHandler
        return QtUIHandler()

    def menu(self):
        from cbpos.interface import MenuRoot
        return [
                [MenuRoot('main',
                            label=cbpos.tr.base_('Main'),
                            icon=cbpos.res.base('images/menu-main.png'),
                            rel=0,
                            priority=5
                          ),
                 MenuRoot('system',<commit_msg>Adapt to core changes in loader<commit_after>from pydispatch import dispatcher

import cbpos
from cbpos.modules import BaseModuleLoader

class ModuleLoader(BaseModuleLoader):
    def load_models(self):
        from cbmod.base.models import StoredFile
        return [StoredFile]

    def init(self):
        from cbmod.base.controllers import printing
        
        printing.manager = printing.PrinterManager()
        
        dispatcher.connect(cbpos.loader.terminate, signal='exit', sender=dispatcher.Any)
        dispatcher.connect(printing.manager.register_function, signal='printing-register-function', sender=dispatcher.Any)
        dispatcher.connect(printing.manager.handle, signal='printing-handle', sender=dispatcher.Any)
        
        return True

    def ui_handler(self):
        from cbmod.base.ui import QtUIHandler
        return QtUIHandler()

    def menu(self):
        from cbpos.interface import MenuRoot
        return [
                [MenuRoot('main',
                            label=cbpos.tr.base_('Main'),
                            icon=cbpos.res.base('images/menu-main.png'),
                            rel=0,
                            priority=5
                          ),
                 MenuRoot('system',
{'fraction_non_alphanumeric': 0.08665860540104796, 'fraction_numerical': 0.0016122531237404273, 'mean_word_length': 2.0157958687727824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2600281', 'n_tokens_mistral': 639, 'n_tokens_neox': 632, 'n_words': 124}