[Pywikipedia-l] SVN: [5665] trunk/pywikipedia/upload.py
jayvdb at svn.wikimedia.org
jayvdb at svn.wikimedia.org
Thu Jul 3 09:36:23 UTC 2008
Revision: 5665
Author: jayvdb
Date: 2008-07-03 09:36:23 +0000 (Thu, 03 Jul 2008)
Log Message:
-----------
-filename to specific the name to upload as
Modified Paths:
--------------
trunk/pywikipedia/upload.py
Modified: trunk/pywikipedia/upload.py
===================================================================
--- trunk/pywikipedia/upload.py 2008-07-02 12:52:15 UTC (rev 5664)
+++ trunk/pywikipedia/upload.py 2008-07-03 09:36:23 UTC (rev 5665)
@@ -5,6 +5,7 @@
Arguments:
-keep Keep the filename as is
+ -filename Target filename
-noverify Do not ask for verification of the upload description if one is given
If any other arguments are given, the first is the URL or filename
@@ -298,6 +299,7 @@
url = u''
description = []
keepFilename = False
+ useFilename = None
verifyDescription = True
# call wikipedia.py function to process all global wikipedia args
@@ -308,6 +310,8 @@
if arg:
if arg.startswith('-keep'):
keepFilename = True
+ elif arg.startswith('-filename:'):
+ useFilename = arg[10:]
elif arg.startswith('-noverify'):
verifyDescription = False
elif url == u'':
@@ -315,7 +319,7 @@
else:
description.append(arg)
description = u' '.join(description)
- bot = UploadRobot(url, description=description, keepFilename=keepFilename, verifyDescription=verifyDescription)
+ bot = UploadRobot(url, description=description, useFilename=useFilename, keepFilename=keepFilename, verifyDescription=verifyDescription)
bot.run()
if __name__ == "__main__":
More information about the Pywikipedia-l
mailing list