jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348485 )
Change subject: upload.py: remove "Do you want to change this description?" when it's empty
......................................................................
upload.py: remove "Do you want to change this description?" when it's empty
- If no description, ask if user want to add one or quit, and loop until one is filled.
- If self.verifyDescription, ask if user want to change it or continue.
- If neither of them, continues
Bug: T163108
Change-Id: Iec43845e293721aee70d8f1129b323d7fbceb8b8
---
M pywikibot/specialbots.py
1 file changed, 16 insertions(+), 12 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/specialbots.py b/pywikibot/specialbots.py
index 72e079c..f18e381 100644
--- a/pywikibot/specialbots.py
+++ b/pywikibot/specialbots.py
@@ -332,24 +332,26 @@
# A proper description for the submission.
# Empty descriptions are not accepted.
- pywikibot.output(u'The suggested description is:\n%s'
- % self.description)
-
- # Description must be set and verified
- if not self.description:
- self.verifyDescription = True
+ if self.description:
+ pywikibot.output('The suggested description is:\n%s'
+ % self.description)
while not self.description or self.verifyDescription:
if not self.description:
pywikibot.output(color_format(
'{lightred}It is not possible to upload a file '
- 'without a summary/description.{default}'))
-
+ 'without a description.{default}'))
assert not always
- # if no description, default is 'yes'
- if pywikibot.input_yn(
- u'Do you want to change this description?',
- default=not self.description):
+ # if no description, ask if user want to add one or quit,
+ # and loop until one is filled.
+ # if self.verifyDescription, ask if user want to change it
+ # or continue.
+ if self.description:
+ question = 'Do you want to change this description?'
+ else:
+ question = 'No description was given. Add one?'
+ if pywikibot.input_yn(question, default=not self.description,
+ automatic_quit=self.description):
from pywikibot import editor as editarticle
editor = editarticle.TextEditor()
try:
@@ -360,6 +362,8 @@
# if user saved / didn't press Cancel
if newDescription:
self.description = newDescription
+ elif not self.description:
+ raise QuitKeyboardInterrupt
self.verifyDescription = False
return filename
--
To view, visit https://gerrit.wikimedia.org/r/348485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iec43845e293721aee70d8f1129b323d7fbceb8b8
Gerrit-PatchSet: 10
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/267435 )
Change subject: Some compat apispec functionality could be used in core
......................................................................
Some compat apispec functionality could be used in core
apispec.py is not used in compat but some methods are usable for core too.
Below is a list where you find the old apispec functionality (left)
in core (right) added to README-conversion.txt.
iso -> Timestamp.isoformat
uniso -> Timestamp.strftime('%Y-%m-%d %H:%M:%S')
dt -> Timestamp.totimestampformat
duration -> BlockEntry.duration
Blocks.__init__ -> (* obsolete constructor *)
Blocks.empty -> (* obsolete parameter cleanup *)
Blocks.query -> site.blocks or site.logevents('block')
Blocks.IPsortkey -> (* sort key, not needed * )
Blocks.allblocks -> site.blocks or site.logevents('block')
Blocks.user -> site.blocks(user=user)
Blocks.IP -> site.blocks(iprange=IP)
Bug: T66835
Change-Id: I310d2b28389d143051afcef5137e60ba20e535ae
---
M README-conversion.txt
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README-conversion.txt b/README-conversion.txt
index d67b702..d2fd9ee 100644
--- a/README-conversion.txt
+++ b/README-conversion.txt
@@ -123,6 +123,22 @@
- contributions(): returns a pywikibot.Timestamp object instead of a Mediawiki one
+== apispec library and Blocks objects ==
+
+Some apispec functionality could be replaced with other methods:
+
+ iso() -> Timestamp.isoformat()
+ uniso() -> Timestamp.strftime('%Y-%m-%d %H:%M:%S')
+ dt() -> Timestamp.totimestampformat()
+ duration() -> BlockEntry.duration()
+
+ Blocks.empty() -> (* obsolete parameter cleanup *)
+ Blocks.query() -> site.blocks() or site.logevents('block')
+ Blocks.IPsortkey() -> (* sort key, not needed * )
+ Blocks.allblocks() -> site.blocks() or site.logevents('block')
+ Blocks.user() -> site.blocks(user=user)
+ Blocks.IP() -> site.blocks(iprange=IP)
+
=== Command-line arguments ===
Scripts that supported unnamed arguments as titles of pages on which to work,
--
To view, visit https://gerrit.wikimedia.org/r/267435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I310d2b28389d143051afcef5137e60ba20e535ae
Gerrit-PatchSet: 14
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Bináris <wikiposta(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>