@classmethod
def apply_state(cls, *bloks):
    """ Call the rigth method is the blok state change

        .. warning::

            for the uninstallation the method called is ``uninstall_all``

        :param bloks: list of the blok name load by the registry
        """
    for blok in bloks:
        b = cls.query().filter(cls.name == blok).first()
        if b.state in ('undefined', 'uninstalled', 'toinstall'):
            b.install()
        elif b.state == 'toupdate':
            b.upgrade()
    uninstalled_bloks = cls.query().filter(cls.state == 'uninstalled').all(
        ).name
    conditional_bloks_to_install = []
    for blok in uninstalled_bloks:
        if cls.check_if_the_conditional_are_installed(blok):
            conditional_bloks_to_install.append(blok)
    if conditional_bloks_to_install:
        for b in conditional_bloks_to_install:
            cls.query().filter(cls.name == b).update({cls.state: 'toinstall'})
        return True
    return False
