示例#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, plugin_map):
    from openregistry.assets.core.design import add_design
    add_design()
    config.add_request_method(extract_asset, 'asset', reify=True)

    # assetType plugins support
    config.registry.assetTypes = {}
    config.add_route_predicate('_internal_type', isAsset)
    config.add_subscriber_predicate('_internal_type', SubscribersPicker)
    config.add_request_method(asset_from_data)
    config.add_directive('add_assetType', register_assetType)
    config.scan("openregistry.assets.core.views")
    config.scan("openregistry.assets.core.subscribers")
    config.registry.registerAdapter(AssetConfigurator, (IAsset, IRequest),
                                    IContentConfigurator)
    config.registry.asset_type_configurator = {}

    LOGGER.info("Included openprocurement.assets.core plugin",
                extra={'MESSAGE_ID': 'included_plugin'})

    # Aliases information
    LOGGER.info('Start aliases')
    get_plugin_aliases(plugin_map.get('plugins', {}))
    LOGGER.info('End aliases')

    # search for plugins
    get_evenly_plugins(config, plugin_map['plugins'],
                       'openregistry.assets.core.plugins')
示例#3
0
def includeme(config, plugin_map):
    from openregistry.lots.core.design import add_design
    add_design()
    config.add_request_method(extract_lot, 'lot', reify=True)

    # lotType plugins support
    config.registry.lotTypes = {}
    config.add_route_predicate('_internal_type', isLot)
    config.add_subscriber_predicate('_internal_type', SubscribersPicker)
    config.add_request_method(lot_from_data)
    config.add_directive('add_lotType', register_lotType)
    config.scan("openregistry.lots.core.views")
    config.scan("openregistry.lots.core.subscribers")
    config.registry.registerAdapter(LotConfigurator, (ILot, IRequest),
                                    IContentConfigurator)

    config.registry.lot_type_configurator = {}

    LOGGER.info("Included openprocurement.lots.core plugin",
                extra={'MESSAGE_ID': 'included_plugin'})

    # search for plugins
    get_evenly_plugins(config, plugin_map['plugins'],
                       'openregistry.lots.core.plugins')