Revision: 7550
Author:   alexsh
Date:     2009-10-27 21:11:54 +0000 (Tue, 27 Oct 2009)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    trunk/pywikipedia/checkimages.py
    trunk/pywikipedia/upload.py

Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py    2009-10-27 17:19:38 UTC (rev 7549)
+++ trunk/pywikipedia/checkimages.py    2009-10-27 21:11:54 UTC (rev 7550)
@@ -479,20 +479,20 @@
 class Global(object):
     # default environment settings
     # Command line configurable parameters
-    repeat = True # Restart after having check all the images?
-    limit = 80 # How many images check?
-    time_sleep = 30 # How many time sleep after the check?
-    skip_number = 0 # How many images to skip before checking?
-    waitTime = 0 # How many time sleep before the check?
-    commonsActive = False # Check if on commons there's an image with the same 
name?
-    normal = False # Check the new images or use another generator?
-    urlUsed = False # Use the url-related function instead of the new-pages 
generator
-    regexGen = False # Use the regex generator
-    untagged = False # Use the untagged generator   
+    repeat = True            # Restart after having check all the images?
+    limit = 80               # How many images check?
+    time_sleep = 30          # How many time sleep after the check?
+    skip_number = 0          # How many images to skip before checking?
+    waitTime = 0             # How many time sleep before the check?
+    commonsActive = False    # Check if on commons there's an image with the 
same name?
+    normal = False           # Check the new images or use another generator?
+    urlUsed = False          # Use the url-related function instead of the 
new-pages generator
+    regexGen = False         # Use the regex generator
+    untagged = False         # Use the untagged generator   
     duplicatesActive = False # Use the duplicate option
     duplicatesReport = False # Use the duplicate-report option
-    sendemailActive = False # Use the send-email
-    logFullError = True # Raise an error when the log is full
+    sendemailActive = False  # Use the send-email
+    logFullError = True      # Raise an error when the log is full
     
     
 # Here there is the main class.

Modified: trunk/pywikipedia/upload.py
===================================================================
--- trunk/pywikipedia/upload.py 2009-10-27 17:19:38 UTC (rev 7549)
+++ trunk/pywikipedia/upload.py 2009-10-27 21:11:54 UTC (rev 7550)
@@ -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



_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to