Arello-Mobile / confluence-publisher

Tool for publishing Sphinx generated documents to Confluence
MIT License
50 stars 33 forks source link

Use list attachments to get the 50 first attachments, add the mimetype #8

Closed rastaman closed 7 years ago

rastaman commented 7 years ago

The following changes have been done in order to publish content on an Atlassian Cloud Confluence instance (Confluence 1000.904.0).

In confluence.py the publish function of the AttachmentPublisher has been modified:

In confluence_api.py, the _create_attachment method now send the mime-type, the binary data and the name of each attachment to the Confluence REST API.

Also in confluence_api.py, the return type of list_attachments has been changed to return only the results part of the response of the REST API. Perhaps it is not advisable, but i have seen no other use of the _api.list_attachments method in the code than in the new implementation of AttachmentPublisher.publish proposed here.

I hope to not have broke anything with previous versions of Confluence, and should probably create a new ConfluenceRestApi, let me know.

Thanks for your time, Best regards.