jenkins-bot has submitted this change and it was merged. Change subject: pep8-ified scripts/upload.py ......................................................................
pep8-ified scripts/upload.py Change-Id: I941a05ee6a9a3914dc0623720792ff95abeede00 --- M scripts/upload.py 1 file changed, 11 insertions(+), 9 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/upload.py b/scripts/upload.py index 090cc0a..f21e6e1 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -24,10 +24,12 @@ # # Distributed under the terms of the MIT license. # -__version__='$Id$' +__version__ = '$Id$' # -import os, sys, time +import os +import sys +import time import urllib import urlparse import tempfile @@ -104,7 +106,7 @@ retrieved = False pywikibot.output( u"Connection closed at byte %s (%s left)" - % (rlen, content_len)) + % (rlen, content_len)) if accept_ranges and rlen > 0: resume = True pywikibot.output(u"Sleeping for %d seconds..." % dt) @@ -139,14 +141,14 @@ u"The filename on the target wiki will default to: %s" % filename) # FIXME: these 2 belong somewhere else, presumably in family - forbidden = '/' # to be extended + 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'ogv', u'oga', u'tif', u'tiff') # ask until it's valid while True: newfn = pywikibot.input( - u'Enter a better name, or press enter to accept:') + u'Enter a better name, or press enter to accept:') if newfn == "": newfn = filename break @@ -160,8 +162,8 @@ if ext not in allowed_formats: choice = pywikibot.inputChoice( u"File format is not one of [%s], but %s. Continue?" - % (u' '.join(allowed_formats), ext), - ['yes', 'no'], ['y', 'N'], 'N') + % (u' '.join(allowed_formats), ext), + ['yes', 'no'], ['y', 'N'], 'N') if choice == 'n': continue break @@ -195,7 +197,7 @@ filename = self.process_filename() site = self.targetSite - imagepage = pywikibot.ImagePage(site, filename) # normalizes filename + imagepage = pywikibot.ImagePage(site, filename) # normalizes filename imagepage.text = self.description pywikibot.output(u'Uploading file to %s via API....' % site) @@ -231,7 +233,7 @@ else: #No warning, upload complete. pywikibot.output(u"Upload successful.") - return filename #data['filename'] + return filename # data['filename'] def run(self): while not self.urlOK(): -- To view, visit https://gerrit.wikimedia.org/r/80862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I941a05ee6a9a3914dc0623720792ff95abeede00 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits