Example #1
0
def check_config_base():
    from mypkg import config, interfaces, usesconfig

    components.registerAdapter(AdaptRunningConfigToMyConfig, config.MyConfig,
                               IMyConfig)

    print usesconfig.do_a_config_thing()
Example #2
0
def check_config_base():
    from mypkg import config, interfaces, usesconfig

    components.registerAdapter(
        AdaptRunningConfigToMyConfig, config.MyConfig, IMyConfig)

    print usesconfig.do_a_config_thing()
Example #3
0
def check_config_inherited():
    from mypkg import usesconfig
    from otherpkg import config

    class OtherConfig(object):
        def get_attr(self):
            return "an other attr datum"

    components.registerAdapter(AdaptRunningConfigToMyConfig,
                               config.OtherConfig, IMyConfig)

    print usesconfig.do_a_config_thing()
Example #4
0
def check_config_inherited():
    from mypkg import usesconfig
    from otherpkg import config

    class OtherConfig(object):
        def get_attr(self):
            return "an other attr datum"

    components.registerAdapter(
        AdaptRunningConfigToMyConfig, config.OtherConfig, IMyConfig)

    print usesconfig.do_a_config_thing()