新增工程数据

This commit is contained in:
wanyaokun
2024-09-14 11:23:36 +08:00
parent 2b17e44120
commit 0720c6dfcd
94 changed files with 6988 additions and 21 deletions
+18 -6
View File
@@ -56,9 +56,21 @@ class MarkDown:
return strTitle + "\n" + markdown_table
# prjSon = ProjectJson('C:\\Users\\wanyaokun\\Desktop\\markdown\\Project\\110千伏思科变电站工程')
# prjSon.parse()
# tables = prjSon.tables()
# for name,table in tables.items():
# mdObj = MarkDown(table,f'C:\\Users\\wanyaokun\\Desktop\\markdown\\data\\110千伏思科变电站工程\\{table.name()}.md')
# mdObj.build()
if __name__ == "__main__":
intputDir = ''
outputDir = ''
subdirectories = {}
for dp, dn, fn in os.walk(intputDir):
for d in dn:
subdirectories[d] = os.path.join(dp, d)
for dirName,dirPath in subdirectories.items():
prjSon = ProjectJson(dirPath)
prjSon.parse()
tables = prjSon.tables()
for name,table in tables.items():
outputPath = os.path.join(outputDir,dirName,f'{table.name()}.md')
mdObj = MarkDown(table,outputPath)
mdObj.build()
-15
View File
@@ -76,19 +76,4 @@ class ProjectJson:
def tables(self):
return self._tables
def getProjectName(dir:str):
result = dir.split('\\')
if len(result) > 0:
return result[-1]
return "未知工程名称"
prjJson = ProjectJson(dir)
prjJson.parse()
tb:JsonTable = prjJson.table('工程属性')
records = tb.records()
for record in records:
name = record.value('名称')
if name == '工程名称':
return record.value('')
return ''