def add_assets_to_graph(g, assets):
"""
:param nx.Graph g:
:param Sequence[Asset] assets:
"""
for asset in assets:
if not asset.referers and not asset.referents:
continue
add_node(g, asset)
for asset in assets:
if not asset.referers and not asset.referents:
continue
for ref in asset.referers:
g.add_edge(ref.relative_path, asset.relative_path)
评论列表
文章目录