我有字典列表:
{'associations': [{'host1': ['v1','v2']}, {'host2': ['v2,v3']}, {'host3': ['v1', 'v7']}]}
我试图通过使用 atlassian-python-api 模块以 YAML 格式将字典列表传递给汇合页面:
confluence_data = yaml.safe_dump(confluence_data['associations'], encoding='utf-8', allow_unicode=True)
confluence = Confluence(
url='https://confluence-url',
username='user',
password='password')
status = confluence.update_or_create(parent_id=someid, title='Test page', body=confluence_data, representation='storage')
但它的出版没有关于汇合的新行。
我尝试使用 pprint 添加新行,但它也没有帮助,因为在这种情况下它会发布空页面:
confluence_data = pprint.pprint(confluence_data, width=1)
我在这里做错了什么?