- change : 添加加载交易接口错误的log
This commit is contained in:
parent
bad997ce9f
commit
ee36ddea45
@ -18,16 +18,19 @@ path = os.path.abspath(os.path.dirname(__file__))
|
|||||||
for root, subdirs, files in os.walk(path):
|
for root, subdirs, files in os.walk(path):
|
||||||
if path != root:
|
if path != root:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for foldername in subdirs:
|
for foldername in subdirs:
|
||||||
# 接口目录名中必须含有Gateway
|
# 接口目录名中必须含有Gateway
|
||||||
if 'Gateway' in foldername:
|
if 'Gateway' in foldername:
|
||||||
# 模块名称需要上前缀
|
# 模块名称需要上前缀
|
||||||
moduleName = 'gateway.' + foldername
|
moduleName = 'gateway.' + foldername
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# 使用importlib动态载入模块,并保存到字典中
|
# 使用importlib动态载入模块,并保存到字典中
|
||||||
module = importlib.import_module(moduleName)
|
module = importlib.import_module(moduleName)
|
||||||
GATEWAY_DICT[module.gatewayName] = module
|
GATEWAY_DICT[module.gatewayName] = module
|
||||||
|
print('load %s' % moduleName)
|
||||||
|
except ImportError:
|
||||||
|
print('module %s not find ' % moduleName)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
Loading…
Reference in New Issue
Block a user