From ee36ddea45d874cf543d3c869bfffd98c5de3ae9 Mon Sep 17 00:00:00 2001 From: lamter Date: Wed, 26 Apr 2017 22:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=20-=20change=20:=20=E6=B7=BB=E5=8A=A0=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=BA=A4=E6=98=93=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/gateway/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vn.trader/gateway/__init__.py b/vn.trader/gateway/__init__.py index 46e147c4..33f0a1b9 100644 --- a/vn.trader/gateway/__init__.py +++ b/vn.trader/gateway/__init__.py @@ -18,16 +18,19 @@ path = os.path.abspath(os.path.dirname(__file__)) for root, subdirs, files in os.walk(path): if path != root: continue - + for foldername in subdirs: # 接口目录名中必须含有Gateway if 'Gateway' in foldername: # 模块名称需要上前缀 moduleName = 'gateway.' + foldername - + try: # 使用importlib动态载入模块,并保存到字典中 module = importlib.import_module(moduleName) GATEWAY_DICT[module.gatewayName] = module + print('load %s' % moduleName) + except ImportError: + print('module %s not find ' % moduleName) except: traceback.print_exc() \ No newline at end of file