http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9562
Revision: 9562 Author: multichill Date: 2011-09-28 19:59:53 +0000 (Wed, 28 Sep 2011) Log Message: ----------- Change title format to: File:title - project - username.jpg
Modified Paths: -------------- trunk/pywikipedia/flickrripper.py
Modified: trunk/pywikipedia/flickrripper.py =================================================================== --- trunk/pywikipedia/flickrripper.py 2011-09-27 20:19:40 UTC (rev 9561) +++ trunk/pywikipedia/flickrripper.py 2011-09-28 19:59:53 UTC (rev 9562) @@ -153,17 +153,17 @@ title = u''
if pywikibot.Page(site, u'File:%s - %s - %s.jpg' - % (project, username, title) ).exists(): + % (title, project, username) ).exists(): i = 1 while True: if (pywikibot.Page(site, u'File:%s - %s - %s (%s).jpg' - % (project, username, title, str(i))).exists()): + % (title, project, username, str(i))).exists()): i = i + 1 else: - return u'%s - %s - %s (%s).jpg' % (project, username, title, + return u'%s - %s - %s (%s).jpg' % (title, project, username, str(i)) else: - return u'%s - %s - %s.jpg' % (project, username, title) + return u'%s - %s - %s.jpg' % (title, project, username)
def cleanUpTitle(title): ''' Clean up the title of a potential mediawiki page. Otherwise the title of
pywikipedia-svn@lists.wikimedia.org