예제 #1
0
def main(ctx: click.Context, config: str) -> None:
    """Find the best properties with crib!"""

    config_file_provider = injection.ObjectProvider(config)

    class Container(app.AppContainer):
        config_file = config_file_provider
        config = injection.SingletonProvider(LoadedConfiguration)

    ctx.obj = Container()
예제 #2
0
 class Container:
     config = injection.ObjectProvider({
         "withconfig": {
             "foo": "test",
             "type": "WithConfig"
         },
         "noconfig": {}
     })
     withconfig = injection.SingletonProvider(WithConfig)
     noconfig = injection.SingletonProvider(NoConfig)
예제 #3
0
class AppContainer(injection.Container):
    config: injection.AbstractProvider = injection.ObjectProvider({})
    config_loaders = PluginsProvider(hook.crib_add_config_loaders)
    directions_service = ConfiguredPluginProvider(
        hook.crib_add_directions_services)
    directions_repository = ConfiguredPluginProvider(
        hook.crib_add_directions_repos)
    user_repository = ConfiguredPluginProvider(hook.crib_add_user_repos)
    property_service = injection.SingletonProvider(PropertyService)
    property_repository = ConfiguredPluginProvider(
        hook.crib_add_property_repos)
    auth_service = injection.SingletonProvider(AuthService)
    scrape = injection.SingletonProvider(Scraper)
예제 #4
0
 class Container(app.AppContainer):
     config = injection.SingletonProvider(config.MemoryConfiguration)
     config_overrides = injection.ObjectProvider(cfg)
예제 #5
0
 class Container:
     config = injection.ObjectProvider({"withconfig": {"bar": "test"}})
     withconfig = injection.SingletonProvider(WithConfig)