jenkins-bot has submitted this change and it was merged.

Change subject: Rename -time into -sleep
......................................................................


Rename -time into -sleep

Bug: T120894
Change-Id: Icb8c97a836ac21ac685fd445622ec2b3d8daf499
---
M scripts/checkimages.py
1 file changed, 13 insertions(+), 6 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 762f6d6..1265920 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -29,7 +29,9 @@
 
 -break              To break the bot after the first check (default: recursive)
 
--time[:#]           Time in seconds between repeat runs (default: 30)
+-sleep[:#]          Time in seconds between repeat runs (default: 30)
+
+-time[:#]           The -time option is deprecated. Use -sleep instead.
 
 -wait[:#]           Wait x second before check the images (default: 0)
 
@@ -1600,12 +1602,17 @@
                     u'How many files do you want to check?'))
             else:
                 limit = int(arg[7:])
-        if arg.startswith('-time'):
-            if len(arg) == 5:
-                time_sleep = int(pywikibot.input(
-                    u'How many seconds do you want runs to be apart?'))
+        if arg.startswith('-sleep') or arg.startswith('-time'):
+            if arg.startswith('-sleep'):
+                length = len('-sleep')
             else:
-                time_sleep = int(arg[6:])
+                pywikibot.tools.issue_deprecation_warning('-time', '-sleep', 2)
+                length = len('-time')
+            if len(arg) == length:
+                time_sleep = int(pywikibot.input(
+                    'How many seconds do you want runs to be apart?'))
+            else:
+                time_sleep = int(arg[length + 1:])
         elif arg == '-break':
             repeat = False
         elif arg == '-nologerror':

-- 
To view, visit https://gerrit.wikimedia.org/r/257822
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb8c97a836ac21ac685fd445622ec2b3d8daf499
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Murfel <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to