From 49ec70ea024d328d36a884b0a8602ddecf049043 Mon Sep 17 00:00:00 2001 From: old-tom <892955278@qq.com> Date: Fri, 28 Apr 2023 17:42:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PDmanReader=20=E8=AF=BB=E5=8F=96json?= =?UTF-8?q?=E6=9C=AA=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exceltpl/pdman/pdman_reader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exceltpl/pdman/pdman_reader.py b/exceltpl/pdman/pdman_reader.py index a82ecf4..7ae3237 100644 --- a/exceltpl/pdman/pdman_reader.py +++ b/exceltpl/pdman/pdman_reader.py @@ -97,7 +97,7 @@ class PDmanReader(object): def _fields_convert(self, fields): rt = [] for f in fields: - if len(f['domain']) > 0: + if 'domain' in f.keys() and len(f['domain']) > 0: f['type'] = self.domains[f['domain']] elif len(str(f['len'])) > 0 and len(str(f['scale'])) == 0: f['type'] = f['type'] + '(' + str(f['len']) + ')' @@ -111,7 +111,7 @@ class PDmanReader(object): # if __name__ == '__main__': - pdfile = r'D:\文档\工作\ATD\2023上半年\项目\昭通OA\表结构\昭通OA.pdma.json' + pdfile = r'C:\Users\89295\Desktop\昭通OA.pdma.json' reader = PDmanReader(pdfile) - all_table = reader.read_by_module('TEST') - print(all_table['test']) + all_table = reader.read_by_module('OA_CAR') + print(all_table)