Revision: 7556
Author: xqt
Date: 2009-10-28 18:10:56 +0000 (Wed, 28 Oct 2009)
Log Message:
-----------
merged with r7550
Modified Paths:
--------------
branches/rewrite/scripts/upload.py
Modified: branches/rewrite/scripts/upload.py
===================================================================
--- branches/rewrite/scripts/upload.py 2009-10-28 18:06:54 UTC (rev 7555)
+++ branches/rewrite/scripts/upload.py 2009-10-28 18:10:56 UTC (rev 7556)
@@ -297,26 +297,20 @@
encodedFilename = filename.encode(self.targetSite.encoding())
- formdata = {}
- formdata["wpUploadDescription"] = self.description
- formdata["wpUploadAffirm"] = "1"
- formdata["wpUpload"] = "upload bestand"
+ formdata = {
+ 'wpUploadDescription': self.description,
+ 'wpUploadAffirm': '1',
+ 'wpUpload': 'upload bestand',
+ 'wpEditToken': self.targetSite.getToken(), # Get an edit token so we
can do the upload
+ 'wpDestFile': filename, # Set the new filename
+ }
# This somehow doesn't work.
if self.ignoreWarning:
formdata["wpIgnoreWarning"] = "1"
- # Get an edit token so we can do the upload
- formdata["wpEditToken"] = self.targetSite.getToken()
-
- # Set the new filename
- formdata["wpDestFile"] = filename
-
if self.uploadByUrl:
formdata["wpUploadFileURL"] = self.url
formdata["wpSourceType"] = 'Url'
- #Not needed now. Might be needed in the future
- #else:
- # formdata["wpSourceType"] = 'file'
# try to encode the strings to the encoding used by the target site.
# if that's not possible (e.g. because there are non-Latin-1 characters and
Show replies by date