http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9782
Revision: 9782
Author: platonides
Date: 2011-11-28 22:16:59 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
Update list of allowed (non-warned) extensions.
As we have ogg, also add .ogv and .oga
Plus .tif, .tiff, and that updates it to the
current list at WMF sites.
Modified Paths:
--------------
trunk/pywikipedia/upload.py
Modified: trunk/pywikipedia/upload.py
===================================================================
--- trunk/pywikipedia/upload.py 2011-11-28 19:14:13 UTC (rev 9781)
+++ trunk/pywikipedia/upload.py 2011-11-28 22:16:59 UTC (rev 9782)
@@ -201,7 +201,8 @@
# FIXME: these 2 belong somewhere else, presumably in family
forbidden = '/' # to be extended
allowed_formats = (u'gif', u'jpg', u'jpeg', u'mid', u'midi',
- u'ogg', u'png', u'svg', u'xcf', u'djvu')
+ u'ogg', u'png', u'svg', u'xcf', u'djvu',
+ u'ogv', u'oga', u'tif', u'tiff')
# ask until it's valid
while not ok:
ok = True
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9781
Revision: 9781
Author: valhallasw
Date: 2011-11-28 19:14:13 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
-excepttitle documentation update: use multiple times for multiple pages
Modified Paths:
--------------
trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py
===================================================================
--- trunk/pywikipedia/replace.py 2011-11-28 14:27:09 UTC (rev 9780)
+++ trunk/pywikipedia/replace.py 2011-11-28 19:14:13 UTC (rev 9781)
@@ -47,7 +47,7 @@
-excepttitle:XYZ Skip pages with titles that contain XYZ. If the -regex
argument is given, XYZ will be regarded as a regular
- expression.
+ expression. Use multiple times to ignore multiple pages.
-requiretitle:XYZ Only do pages with titles that contain XYZ. If the -regex
argument is given, XYZ will be regarded as a regular
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9778
Revision: 9778
Author: multichill
Date: 2011-11-23 19:39:58 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
First chop up description than do the cleanup.
Modified Paths:
--------------
trunk/pywikipedia/flickrripper.py
Modified: trunk/pywikipedia/flickrripper.py
===================================================================
--- trunk/pywikipedia/flickrripper.py 2011-11-23 19:23:57 UTC (rev 9777)
+++ trunk/pywikipedia/flickrripper.py 2011-11-23 19:39:58 UTC (rev 9778)
@@ -155,11 +155,9 @@
if title == u'':
description = photoInfo.find('photo').find('description').text
if description:
- description = cleanUpTitle(description)
if len(description)>120:
- title = description[0 : 120]
- else:
- title = description
+ description = description[0 : 120]
+ title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9777
Revision: 9777
Author: multichill
Date: 2011-11-23 19:23:57 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Huh, where did that ' go?
Modified Paths:
--------------
trunk/pywikipedia/flickrripper.py
Modified: trunk/pywikipedia/flickrripper.py
===================================================================
--- trunk/pywikipedia/flickrripper.py 2011-11-23 18:11:00 UTC (rev 9776)
+++ trunk/pywikipedia/flickrripper.py 2011-11-23 19:23:57 UTC (rev 9777)
@@ -161,7 +161,7 @@
else:
title = description
else:
- title = u'
+ title = u''
# Should probably have the id of the photo as last resort.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9776
Revision: 9776
Author: multichill
Date: 2011-11-23 18:11:00 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Add fallback to description if title is missing.
Modified Paths:
--------------
trunk/pywikipedia/flickrripper.py
Modified: trunk/pywikipedia/flickrripper.py
===================================================================
--- trunk/pywikipedia/flickrripper.py 2011-11-22 22:30:23 UTC (rev 9775)
+++ trunk/pywikipedia/flickrripper.py 2011-11-23 18:11:00 UTC (rev 9776)
@@ -152,6 +152,19 @@
else:
title = u''
+ if title == u'':
+ description = photoInfo.find('photo').find('description').text
+ if description:
+ description = cleanUpTitle(description)
+ if len(description)>120:
+ title = description[0 : 120]
+ else:
+ title = description
+ else:
+ title = u'
+ # Should probably have the id of the photo as last resort.
+
+
if pywikibot.Page(site, u'File:%s - %s - %s.jpg'
% (title, project, username) ).exists():
i = 1