Darthbhyrava has uploaded a new change for review.
https://gerrit.wikimedia.org/r/273842
Change subject: Change flickrripper:remove default values for all parameters\n
Remove default values for all parameters to avoid errors in functions\n Bug:
T93098
......................................................................
Change flickrripper:remove default values for all parameters\n Remove default
values for all parameters to avoid errors in functions\n Bug: T93098
Change-Id: I9519d7d1dc24640920a50dffe6d326b153459721
---
M scripts/flickrripper.py
1 file changed, 15 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/42/273842/1
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index cbbe7d7..f2e97c8 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -80,7 +80,7 @@
}
-def getPhoto(flickr=None, photo_id=''):
+def getPhoto(flickr, photo_id):
"""
Get the photo info and the photo sizes so we can use these later on.
@@ -99,7 +99,7 @@
time.sleep(30)
-def isAllowedLicense(photoInfo=None):
+def isAllowedLicense(photoInfo):
"""
Check if the image contains the right license.
@@ -112,7 +112,7 @@
return False
-def getPhotoUrl(photoSizes=None):
+def getPhotoUrl(photoSizes):
"""Get the url of the jpg file with the highest resolution."""
url = ''
# The assumption is that the largest image is last
@@ -121,7 +121,7 @@
return url
-def downloadPhoto(photoUrl=''):
+def downloadPhoto(photoUrl):
"""
Download the photo and store it in a io.BytesIO object.
@@ -132,7 +132,7 @@
return io.BytesIO(imageFile)
-def findDuplicateImages(photo, site=None):
+def findDuplicateImages(photo, site):
"""Find duplicate images.
Take the photo, calculate the SHA1 hash and ask the MediaWiki api
@@ -153,7 +153,7 @@
return site.getFilesFromAnHash(base64.b16encode(hashObject.digest()))
-def getTags(photoInfo=None):
+def getTags(photoInfo):
"""Get all the tags on a photo."""
result = []
for tag in photoInfo.find('photo').find('tags').findall('tag'):
@@ -162,7 +162,7 @@
return result
-def getFlinfoDescription(photo_id=0):
+def getFlinfoDescription(photo_id):
"""
Get the description from http://wikipedia.ramselehof.de/flinfo.php.
@@ -174,7 +174,7 @@
'http://wikipedia.ramselehof.de/flinfo.php?%s' % parameters).content
-def getFilename(photoInfo=None, site=None, project=u'Flickr'):
+def getFilename(photoInfo, site, project):
"""Build a good filename for the upload based on the username and title.
Prevents naming collisions.
@@ -244,8 +244,8 @@
return title
-def buildDescription(flinfoDescription=u'', flickrreview=False, reviewer=u'',
- override=u'', addCategory=u'', removeCategories=False):
+def buildDescription(flinfoDescription, flickrreview, reviewer,
+ override, addCategory, removeCategories):
"""Build the final description for the image.
The description is based on the info from flickrinfo and improved.
@@ -279,9 +279,9 @@
return description
-def processPhoto(flickr=None, photo_id=u'', flickrreview=False, reviewer=u'',
- override=u'', addCategory=u'', removeCategories=False,
- autonomous=False):
+def processPhoto(flickr, photo_id, flickrreview, reviewer,
+ override, addCategory, removeCategories,
+ autonomous):
"""Process a single Flickr photo."""
if photo_id:
pywikibot.output(str(photo_id))
@@ -342,8 +342,8 @@
return 0
-def getPhotos(flickr=None, user_id=u'', group_id=u'', photoset_id=u'',
- start_id='', end_id='', tags=u''):
+def getPhotos(flickr, user_id, group_id, photoset_id,
+ start_id, end_id, tags):
"""Loop over a set of Flickr photos."""
found_start_id = not start_id
--
To view, visit https://gerrit.wikimedia.org/r/273842
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9519d7d1dc24640920a50dffe6d326b153459721
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Darthbhyrava <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits