Skip to content
Snippets Groups Projects
Commit 0aa748f8 authored by Bryan Tong Minh's avatar Bryan Tong Minh
Browse files

Allow setting both the upload description and the page content separately

parent a2723e7d
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ RELEASE NOTES FOR MWCLIENT
This is mwclient 0.6.6. The following are the release notes for this version.
== Changes in version 0.6.6 ==
No changes yet.
* Allow setting both the upload description and the page content separately
== Changes in version 0.6.5 ==
* Explicitly convert the Content-Length header to str, avoiding a TypeError
......
......@@ -353,7 +353,7 @@ class Site(object):
def upload(self, file = None, filename = None, description = '', ignore = False, file_size = None,
url = None, session_key = None):
url = None, session_key = None, comment = None):
"""Upload a file to the wiki."""
if self.version[:2] < (1, 16):
return compatibility.old_upload(self, file = file, filename = filename,
......@@ -368,7 +368,12 @@ class Site(object):
predata = {}
predata['comment'] = description
if comment is None:
predata['comment'] = description
else:
predata['comment'] = comment
predata['text'] = description
if ignore:
predata['ignorewarnings'] = 'true'
predata['token'] = image.get_token('edit')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment