Revision: 7482
Author:   a_engels
Date:     2009-10-17 03:17:12 +0000 (Sat, 17 Oct 2009)

Log Message:
-----------
ask for categories separately

Modified Paths:
--------------
    trunk/pywikipedia/imageharvest.py

Modified: trunk/pywikipedia/imageharvest.py
===================================================================
--- trunk/pywikipedia/imageharvest.py   2009-10-16 20:00:34 UTC (rev 7481)
+++ trunk/pywikipedia/imageharvest.py   2009-10-17 03:17:12 UTC (rev 7482)
@@ -89,8 +89,16 @@
         answer = wikipedia.inputChoice(u'Include image %s?' % image, ['yes', 
'no', 'stop'], ['y', 'N', 's'], 'N')
         if answer == 'y':
             desc = wikipedia.input(u"Give the description of this image:")
-            desc = desc + "\r\n\n\r" + basicdesc
-            uploadBot = upload.UploadRobot(image, desc)
+            categories = []
+            while True:
+                cat = wikipedia.input(u"Specify a category (or press enter to 
end adding categories)")
+                if not cat.strip(): break
+                if ":" in cat:
+                    categories.append("[["+cat+"]]")
+                else:
+                    categories.append("[["+mysite.namespace(14)+":"+cat+"]]")
+            desc = desc + "\r\n\r\n" + basicdesc + "\r\n\r\n" + " 
".join(categories)
+            uploadBot = upload.UploadRobot(image, description = desc)
             uploadBot.run()
         elif answer == 's':
             break



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

Reply via email to