Skip to content

Commit c1ccf52

Browse files
committed
graph格式
1 parent d5e4eb8 commit c1ccf52

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

pydbdoc.py

+3-32
Original file line numberDiff line numberDiff line change
@@ -185,42 +185,13 @@ def output_graph(self, dest, override):
185185
}
186186
_output.append(generator.label(**_table_data))
187187

188-
content = ''.join(_output)
188+
labels = ''.join(_output)
189+
190+
content = generator.graph(labels, '')
189191

190192
with open(dest, 'w') as f:
191193
f.write(content)
192194

193-
def format_db_graph(self, table, columns):
194-
"""
195-
:param table:
196-
:param columns:
197-
:return:
198-
"""
199-
generator = self.graph_generator
200-
201-
_output = list()
202-
203-
# 表名
204-
table_name = table.name
205-
table_comment = ''
206-
if table.comment:
207-
table_comment = table.comment
208-
else:
209-
if table.name in self.migration_tables:
210-
table_comment = self.migration_tables[table.name]
211-
212-
# _output.append("%s %s" % (generator.highline(table.engine), generator.highline(table.collation)))
213-
# 字段输出
214-
_table_data = {
215-
'table_name': table.name,
216-
'table_comment': table_comment,
217-
# 'columns': ['字段名', '类型', '是否可NULL', '描述'],
218-
'data': [[column.name, column.field_type, column.if_null, column.comment.replace(os.linesep, '')] for column
219-
in columns],
220-
}
221-
_output.append(generator.label(**_table_data))
222-
return _output
223-
224195
def output_markdown(self, dest, override, gitlab=False):
225196

226197
self.init_path(dest, override)

0 commit comments

Comments
 (0)