jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/401675 )
Change subject: download_dump: Change `revision` term to `dumpdate` ......................................................................
download_dump: Change `revision` term to `dumpdate`
The revision term in this script would imply a Revision which differs much. This commit renames `revision` term to `dumpdate`.
Bug: T184035 Change-Id: I099d930335acbb324ebae93c4e3337b6bbe1593d --- M scripts/maintenance/download_dump.py 1 file changed, 10 insertions(+), 10 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/maintenance/download_dump.py b/scripts/maintenance/download_dump.py index 7b27c6d..f26e8bc 100644 --- a/scripts/maintenance/download_dump.py +++ b/scripts/maintenance/download_dump.py @@ -9,12 +9,12 @@
-storepath:# The stored file's path.
- -revision:# The revision date of the dump (default to `latest`) + -dumpdate:# The dumpdate date of the dump (default to `latest`) formatted as YYYYMMDD.
""" # -# (C) Pywikibot team, 2017 +# (C) Pywikibot team, 2018 # (C) Yifei He, 2017 # # Distributed under the terms of the MIT license. @@ -58,7 +58,7 @@ 'wikiname': '', 'filename': '', 'storepath': './', - 'revision': 'latest', + 'dumpdate': 'latest', }
def get_dump_name(self, db_name, typ): @@ -86,9 +86,9 @@
pywikibot.output('Downloading dump from ' + self.getOption('wikiname'))
- download_filename = '{wiki_name}-{revision}-{filename}'.format( + download_filename = '{wiki_name}-{dumpdate}-{filename}'.format( wiki_name=self.getOption('wikiname'), - revision=self.getOption('revision'), + dumpdate=self.getOption('dumpdate'), filename=self.getOption('filename') ) temp_filename = download_filename + '-' + \ @@ -117,7 +117,7 @@ else: url = 'https://dumps.wikimedia.org/%7B0%7D/%7B1%7D/%7B2%7D%27.format( self.getOption('wikiname'), - self.getOption('revision'), + self.getOption('dumpdate'), download_filename) pywikibot.output('Downloading file from ' + url) response = fetch(url, stream=True) @@ -160,11 +160,11 @@ elif response.status == 404: pywikibot.output( 'File with name "{filename}", ' - 'from revision "{revision}", ' + 'from dumpdate "{dumpdate}", ' 'and wiki "{wikiname}" ({url}) isn't ' 'available in the Wikimedia Dumps'.format( filename=self.getOption('filename'), - revision=self.getOption('revision'), + dumpdate=self.getOption('dumpdate'), url=url, wikiname=self.getOption('wikiname'))) return @@ -221,9 +221,9 @@ opts[option] = os.path.abspath(value) or pywikibot.input( 'Enter the store path: ') continue - elif option == 'revision': + elif option == 'dumpdate': opts[option] = value or pywikibot.input( - 'Enter the revision of the dump: ') + 'Enter the dumpdate of the dump: ') continue
unknown_args += [arg]
pywikibot-commits@lists.wikimedia.org