logistics/utils/apply_active_config.py

40 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from logisticsClass.logisticsBaseClass import HeadLogistics, PortType, TailLogistics,BaseLogistics
# logistics_config.py
ACTIVE_LOGISTICS = {
# US
"FedexPPLogistics_US": False,# 需关闭
"FedexKHLogistics_US": False,# 需关闭
"FedexHOMELogistics_US": True,
"FedexGROUDLogistics_US": True,
"MetroLogistics_US": True,
"GIGALogistics_US": False,# 需关闭
"CEVALogistics_US": False,# 需关闭
"XmilesLogistics_US":True,
"AMTWestLogistics_US":True,
"AMTEastLogistics_US":True,
# UK
"DPDLogistics_UK": True,
"bigLogistics_UK": True,
"KPZGLogistics_UK": True,
"KPNVlogistics_UK": False,# 需关闭
# EUR
"DPDASLLogistics":False, # 需关闭
# GB
"bigLogistics_UK":False, # 需关闭
"KPZGLogistics_UK":False, # 需关闭
"bigLogistics_UK":False, # 需关闭,智谷旧版大件8新版是分区的
}
def apply_active_config():
stack = list(BaseLogistics.__subclasses__())
while stack:
subclass = stack.pop()
name = subclass.__name__
if name in ACTIVE_LOGISTICS:
subclass.active = ACTIVE_LOGISTICS[name]
# 否则保持默认的 active
stack.extend(subclass.__subclasses__())