From d2c8274afdd2947098cfeefc8587717647df947b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 1 Jul 2024 22:11:00 -0500 Subject: [PATCH] fix: avoid deprecated function for `get_engines()` config --- rattail_corepos/config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rattail_corepos/config.py b/rattail_corepos/config.py index c6cb8d2..cdb032e 100644 --- a/rattail_corepos/config.py +++ b/rattail_corepos/config.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2023 Lance Edgar +# Copyright © 2010-2024 Lance Edgar # # This file is part of Rattail. # @@ -26,8 +26,9 @@ Rattail-COREPOS Config Extension import warnings +from wuttjamaican.db.conf import get_engines + from rattail.config import ConfigExtension -from rattail.db.config import get_engines class RattailCOREPOSExtension(ConfigExtension): @@ -45,7 +46,7 @@ class RattailCOREPOSExtension(ConfigExtension): # office_op from corepos.db.office_op import Session - engines = get_engines(config, section='corepos.db.office_op') + engines = get_engines(config, 'corepos.db.office_op') config.core_office_op_engines = engines config.core_office_op_engine = engines.get('default') Session.configure(bind=config.core_office_op_engine) @@ -55,7 +56,7 @@ class RattailCOREPOSExtension(ConfigExtension): # office_trans from corepos.db.office_trans import Session - engines = get_engines(config, section='corepos.db.office_trans') + engines = get_engines(config, 'corepos.db.office_trans') config.core_office_trans_engines = engines config.core_office_trans_engine = engines.get('default') Session.configure(bind=config.core_office_trans_engine) @@ -65,9 +66,9 @@ class RattailCOREPOSExtension(ConfigExtension): # office_arch from corepos.db.office_arch import Session - engines = get_engines(config, section='corepos.db.office_arch') + engines = get_engines(config, 'corepos.db.office_arch') if not engines: - engines = get_engines(config, section='corepos.db.office_trans_archive') + engines = get_engines(config, 'corepos.db.office_trans_archive') if engines: warnings.warn("config section [corepos.db.office_trans_archive] is deprecated; " "please use section [corepos.db.office_arch] instead", @@ -81,7 +82,7 @@ class RattailCOREPOSExtension(ConfigExtension): # lane_op from corepos.db.lane_op import Session - engines = get_engines(config, section='corepos.db.lane_op') + engines = get_engines(config, 'corepos.db.lane_op') config.core_lane_op_engines = engines config.core_lane_op_engine = engines.get('default') Session.configure(bind=config.core_lane_op_engine)