Example #1
0
def includeme(config, plugin_map):
    add_design()
    config.add_subscriber(set_logging_context, ContextFound)

    # auction procurementMethodType plugins support
    config.registry.auction_procurementMethodTypes = {}
    config.registry.pmtConfigurator = {}
    config.add_route_predicate('auctionsprocurementMethodType', isAuction)
    config.add_route_predicate('awardingType', awardingTypePredicate)
    config.add_subscriber_predicate('auctionsprocurementMethodType',
                                    SubscribersPicker)
    config.add_request_method(extract_auction, 'auction', reify=True)
    config.add_request_method(auction_from_data)
    config.add_directive('add_auction_procurementMethodType',
                         register_auction_procurementMethodType)
    config.scan("openprocurement.auctions.core.views")
    config.scan("openprocurement.api.subscribers")
    config.scan("openprocurement.auctions.core.subscribers")
    init_plugins(config)

    # register Adapters
    config.registry.registerAdapter(AuctionConfigurator, (IAuction, IRequest),
                                    IContentConfigurator)
    config.registry.registerAdapter(AuctionAwardingNextCheckAdapter,
                                    (IAuction, ), IAwardingNextCheck)

    config.add_request_method(get_content_configurator,
                              'content_configurator',
                              reify=True)
    LOGGER.info("Included openprocurement.auctions.core plugin",
                extra={'MESSAGE_ID': 'included_plugin'})
    get_evenly_plugins(config, plugin_map['plugins'],
                       'openprocurement.auctions.core.plugins')
def includeme(config):
    add_design()
    config.add_subscriber(set_logging_context, ContextFound)
    config.add_request_method(extract_auction, 'auction', reify=True)
    config.scan("openprocurement.auctions.core.views")

    plugins = config.registry.settings.get(
        'plugins') and config.registry.settings['plugins'].split(',')
    for entry_point in iter_entry_points(
            'openprocurement.auctions.core.plugins'):
        if not plugins or entry_point.name in plugins:
            plugin = entry_point.load()
            plugin(config)
def includeme(config):
    add_design()
    config.add_subscriber(set_logging_context, ContextFound)
    config.scan("openprocurement.auctions.core.views")

    # auction procurementMethodType plugins support
    config.add_route_predicate('auctionsprocurementMethodType', isAuction)
    config.registry.auction_procurementMethodTypes = {}
    config.add_request_method(extract_auction, 'auction', reify=True)
    config.add_request_method(auction_from_data)
    config.add_directive('add_auction_procurementMethodType', register_auction_procurementMethodType)

    plugins = config.registry.settings.get('plugins') and config.registry.settings['plugins'].split(',')
    for entry_point in iter_entry_points('openprocurement.auctions.core.plugins'):
        if not plugins or entry_point.name in plugins:
            plugin = entry_point.load()
            plugin(config)
def includeme(config):
    add_design()
    config.add_subscriber(set_logging_context, ContextFound)
    config.scan("openprocurement.auctions.core.views")

    # auction procurementMethodType plugins support
    puginns = config.registry.app_meta(['plugins'])
    config.add_route_predicate('auctionsprocurementMethodType', isAuction)
    config.registry.auction_procurementMethodTypes = {}
    config.add_request_method(extract_auction, 'auction', reify=True)
    config.add_request_method(auction_from_data)
    config.add_directive('add_auction_procurementMethodType',
                         register_auction_procurementMethodType)
    config.registry.registerAdapter(AuctionConfigurator, (IAuction, IRequest),
                                    IContentConfigurator)

    plugins = config.registry.app_meta(['plugins'])
    for entry_point in iter_entry_points(
            'openprocurement.auctions.core.plugins'):
        if not plugins or entry_point.name in plugins:
            plugin = entry_point.load()
            plugin(config)