Source

callchain / callchain / registry.py

Full commit
# -*- coding: utf-8 -*-
'''callchain managers'''

from stuf.utils import lazy
from appspace import Manager
from appspace.keys import AApp

from callchain.keys.settings import KInternalSettings, KExternalSettings


class ChainRegistry(Manager):

    '''chain registry'''

    __slots__ = ('_current', '_root', '_key')

    def __init__(self, label, key=AApp):
        '''
        init

        @param label: label for appspace
        @param key: default key for appspace (default: AApp)
        '''
        super(ChainRegistry, self).__init__(label, key)

    @lazy
    def internal_settings(self):
        '''internal settings'''
        return self.ez_lookup(KInternalSettings, self._root)()

    @lazy
    def external_settings(self):
        '''external settings'''
        return self.ez_lookup(KExternalSettings, self._root)()