jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/323705 )
Change subject: [DOC] remove deprecated options from -help string ......................................................................
[DOC] remove deprecated options from -help string
- The local usage of -yesterday and -recentchanges are deprecated. They should be removed from -help string. Pagegenerators options are displayed and used instead.
- Remove "to do" remark from uploadedYesterday generator which is obsolete.
- Remove recentChanges generator which is not used anymore and solely part of the user scripts and not part of the framework library.
Change-Id: I1bad42fe172bc1e0d7e4bcd850ec6d497df2c896 --- M scripts/imageuncat.py 1 file changed, 4 insertions(+), 36 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/imageuncat.py b/scripts/imageuncat.py index 476bac3..2e3693c 100755 --- a/scripts/imageuncat.py +++ b/scripts/imageuncat.py @@ -8,21 +8,11 @@ This script is working on the given site, so if the commons should be handled, the site commons should be given and not a Wikipedia or similar.
--yesterday Go through all uploads from yesterday. (Deprecated here, - moved to pagegenerators) - --recentchanges Go through the changes made from 'offset' minutes with - 'duration' minutes of timespan. It must be given two - arguments as - '-recentchanges:offset,duration' - - Default value of offset is 120, and that of duration is 70 - ¶ms; """ # # (C) Multichill, 2008 -# (C) Pywikibot team, 2009-2015 +# (C) Pywikibot team, 2009-2017 # # Distributed under the terms of the MIT license. # @@ -36,9 +26,7 @@ import pywikibot from pywikibot.exceptions import ArgumentDeprecationWarning from pywikibot import pagegenerators -from pywikibot.tools import ( - issue_deprecation_warning, deprecated -) +from pywikibot.tools import issue_deprecation_warning
docuReplacements = { '¶ms;': pagegenerators.parameterHelp, @@ -1264,33 +1252,13 @@ """ Return a pagegenerator containing all the pictures uploaded yesterday.
- Should probably copied to somewhere else + DEPRECATED. Only used by a deprecated option. """ today = pywikibot.Timestamp.utcnow() yesterday = today + timedelta(days=-1)
for logentry in site.logevents(logtype='upload', start=yesterday, end=today, reverse=True): yield logentry.page() - - -@deprecated('RecentChangesPageGenerator') -def recentChanges(site=None, delay=0, block=70): - """ - Return a pagegenerator containing all the images edited in a certain timespan. - - The delay is the amount of minutes to wait and the block is the timespan to return images in. - Should probably be copied to somewhere else - """ - rcstart = site.getcurrenttime() + timedelta(minutes=-(delay + block)) - rcend = site.getcurrenttime() + timedelta(minutes=-delay) - - gen = site.recentchanges(start=rcstart, end=rcend, reverse=True, - namespaces=6, changetype='edit|log', - showBot=False) - # remove 'patrolled' from rcprop since we can't get it - gen.request['rcprop'] = 'title|user|comment|ids' - for p in gen: - yield pywikibot.Page(site, p['title'], p['ns'])
def isUncat(page): @@ -1391,7 +1359,7 @@ if param_value is None: arg = arg + ':120,70' issue_deprecation_warning( - '-recentchanges', + '-recentchanges without parameters', '-recentchanges:offset,duration', 2, ArgumentDeprecationWarning) genFactory.handleArg(arg)
pywikibot-commits@lists.wikimedia.org