jenkins-bot has submitted this change and it was merged.
Change subject: Use setuptools for SVN support
......................................................................
Use setuptools for SVN support
setuptools supports SVN 1.6+, and is included in the
Windows py2.7 installer, and works for 1.8+ even if the
entries file is missing.
Update getversion to rotate through git, svn and nightly detectors
before falling back to alternative version algorithms.
Bug: T95075
Bug: T95077
Change-Id: I49cf168054dde5ed313970b4ac63de35d1d21d38
---
M pywikibot/version.py
1 file changed, 150 insertions(+), 34 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 85f37a9..b3ba9eb 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -19,11 +19,26 @@
import subprocess
import codecs
+from warnings import warn
+
+try:
+ from setuptools import svn_utils
+except ImportError:
+ try:
+ from setuptools_svn import svn_utils
+ except ImportError as e:
+ svn_utils = e
+
import pywikibot
+
+from pywikibot import config2 as config
from pywikibot.tools import deprecated
-import pywikibot.config2 as config
+
+if sys.version_info[0] > 2:
+ basestring = (str, )
cache = None
+_logger = 'version'
class ParseError(Exception):
@@ -57,39 +72,61 @@
def getversiondict():
+ """Get version info for the package.
+
+ @return:
+ - tag (name for the repository),
+ - rev (current revision identifier),
+ - date (date of current revision),
+ - hash (git hash for the current revision)
+ @rtype: C{dict} of four C{str}
+ """
global cache
if cache:
return cache
- try:
- _program_dir = _get_program_dir()
- if os.path.isdir(os.path.join(_program_dir, '.svn')):
- (tag, rev, date, hsh) = getversion_svn(_program_dir)
- elif os.path.isdir(os.path.join(_program_dir, '../.svn')):
- (tag, rev, date, hsh) = getversion_svn(os.path.join(_program_dir, '..'))
- else:
- (tag, rev, date, hsh) = getversion_git(_program_dir)
- except Exception:
+
+ _program_dir = _get_program_dir()
+ exceptions = {}
+
+ for vcs_func in (getversion_git,
+ getversion_svn_setuptools,
+ getversion_nightly,
+ getversion_svn,
+ getversion_package):
try:
- (tag, rev, date, hsh) = getversion_nightly()
- except Exception:
- try:
- hsh = get_module_version(pywikibot)
- date = get_module_mtime(pywikibot).timetuple()
+ (tag, rev, date, hsh) = vcs_func(_program_dir)
+ except Exception as e:
+ exceptions[vcs_func] = e
+ else:
+ break
+ else:
+ # nothing worked; version unknown (but suppress exceptions)
+ # the value is most likely '$Id' + '$', it means that
+ # pywikibot was imported without using version control at all.
+ tag, rev, date, hsh = (
+ '', '-1 (unknown)', '0 (unknown)', '(unknown)')
- tag = 'pywikibot/__init__.py'
- rev = '-1 (unknown)'
- except:
- # nothing worked; version unknown (but suppress exceptions)
- # the value is most likely '$Id' + '$', it means that
- # pywikibot was imported without using version control at all.
- return dict(tag='', rev='-1 (unknown)', date='0 (unknown)',
- hsh='(unknown)')
+ # git and svn can silently fail, as it may be a nightly.
+ if getversion_package in exceptions:
+ warn('Unable to detect version; exceptions raised:\n%r'
+ % exceptions, UserWarning)
+ elif exceptions:
+ pywikibot.debug('version algorithm exceptions:\n%r'
+ % exceptions, _logger)
- datestring = time.strftime('%Y/%m/%d, %H:%M:%S', date)
+ if isinstance(date, basestring):
+ datestring = date
+ elif isinstance(date, time.struct_time):
+ datestring = time.strftime('%Y/%m/%d, %H:%M:%S', date)
+ else:
+ warn('Unable to detect package date', UserWarning)
+ datestring = '-2 (unknown)'
+
cache = dict(tag=tag, rev=rev, date=datestring, hsh=hsh)
return cache
+@deprecated('getversion_svn_setuptools')
def svn_rev_info(path):
"""Fetch information about the current revision of an Subversion checkout.
@@ -98,9 +135,13 @@
- tag (name for the repository),
- rev (current Subversion revision identifier),
- date (date of current revision),
- @rtype: C{tuple} of 3 C{str}
+ @rtype: C{tuple} of two C{str} and a C{time.struct_time}
"""
+ if not os.path.isdir(os.path.join(path, '.svn')):
+ path = os.path.join(path, '..')
+
_program_dir = path
+
entries = open(os.path.join(_program_dir, '.svn/entries'))
version = entries.readline().strip()
# use sqlite table for new entries format
@@ -152,11 +193,43 @@
headers={'label': str(rev),
'user-agent': 'SVN/1.7.5 {pwb}'})
data = request.content
+
dom = xml.dom.minidom.parse(StringIO(data))
hsh = dom.getElementsByTagName("C:git-commit")[0].firstChild.nodeValue
- return hsh
+ date = dom.getElementsByTagName("S:date")[0].firstChild.nodeValue
+ date = time.strptime(date[:19], '%Y-%m-%dT%H:%M:%S')
+ return hsh, date
+def getversion_svn_setuptools(path=None):
+ """Get version info for a Subversion checkout using setuptools.
+
+ @param path: directory of the Subversion checkout
+ @return:
+ - tag (name for the repository),
+ - rev (current Subversion revision identifier),
+ - date (date of current revision),
+ - hash (git hash for the Subversion revision)
+ @rtype: C{tuple} of three C{str} and a C{time.struct_time}
+ """
+ if isinstance(svn_utils, Exception):
+ raise svn_utils
+ tag = 'pywikibot-core'
+ _program_dir = path or _get_program_dir()
+ svninfo = svn_utils.SvnInfo(_program_dir)
+ rev = svninfo.get_revision()
+ if not isinstance(rev, int):
+ raise TypeError('SvnInfo.get_revision() returned type %s' % type(rev))
+ if rev < 0:
+ raise ValueError('SvnInfo.get_revision() returned %d' % rev)
+ if rev == 0:
+ raise ParseError('SvnInfo: invalid workarea')
+ hsh, date = github_svn_rev2hash(tag, rev)
+ rev = 's%s' % rev
+ return (tag, rev, date, hsh)
+
+
+@deprecated('getversion_svn_setuptools')
def getversion_svn(path=None):
"""Get version info for a Subversion checkout.
@@ -166,11 +239,12 @@
- rev (current Subversion revision identifier),
- date (date of current revision),
- hash (git hash for the Subversion revision)
- @rtype: C{tuple} of 4 C{str}
+ @rtype: C{tuple} of three C{str} and a C{time.struct_time}
"""
_program_dir = path or _get_program_dir()
tag, rev, date = svn_rev_info(_program_dir)
- hsh = github_svn_rev2hash(tag, rev)
+ hsh, date2 = github_svn_rev2hash(tag, rev)
+ assert(date == date2)
rev = 's%s' % rev
if (not date or not tag or not rev) and not path:
raise ParseError
@@ -178,6 +252,16 @@
def getversion_git(path=None):
+ """Get version info for a Git clone.
+
+ @param path: directory of the Git checkout
+ @return:
+ - tag (name for the repository),
+ - rev (current revision identifier),
+ - date (date of current revision),
+ - hash (git hash for the current revision)
+ @rtype: C{tuple} of three C{str} and a C{time.struct_time}
+ """
_program_dir = path or _get_program_dir()
cmd = 'git'
try:
@@ -222,18 +306,50 @@
return (tag, rev, date, hsh)
-def getversion_nightly():
- data = open(os.path.join(os.path.split(__file__)[0], 'version'))
- tag = data.readline().strip()
- rev = data.readline().strip()
- date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S')
- hsh = data.readline().strip()
+def getversion_nightly(path=None):
+ """Get version info for a nightly release.
+
+ @param path: directory of the uncompressed nightly.
+ @return:
+ - tag (name for the repository),
+ - rev (current revision identifier),
+ - date (date of current revision),
+ - hash (git hash for the current revision)
+ @rtype: C{tuple} of three C{str} and a C{time.struct_time}
+ """
+ if not path:
+ path = _get_program_dir()
+
+ with open(os.path.join(path, 'version')) as data:
+ (tag, rev, date, hsh) = data.readlines()
+
+ date = time.strptime(date[:19], '%Y-%m-%dT%H:%M:%S')
if not date or not tag or not rev:
raise ParseError
return (tag, rev, date, hsh)
+def getversion_package(path=None): # pylint: disable=unused-argument
+ """Get version info for an installed package.
+
+ @param path: Unused argument
+ @return:
+ - tag: 'pywikibot/__init__.py'
+ - rev: '-1 (unknown)'
+ - date (date the package was installed locally),
+ - hash (git hash for the current revision of 'pywikibot/__init__.py')
+ @rtype: C{tuple} of four C{str}
+ """
+ hsh = get_module_version(pywikibot)
+ date = get_module_mtime(pywikibot).timetuple()
+
+ tag = 'pywikibot/__init__.py'
+ rev = '-1 (unknown)'
+
+ return (tag, rev, date, hsh)
+
+
def getversion_onlinerepo(repo=None):
"""Retrieve current framework revision number from online repository.
--
To view, visit https://gerrit.wikimedia.org/r/201931
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I49cf168054dde5ed313970b4ac63de35d1d21d38
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] allowed_failure: Only print relevant stack
......................................................................
[FEAT] allowed_failure: Only print relevant stack
Instead of printing the complete stack it now only prints the stack up
until the 'assert[A-Z]' which is part of unittest. To avoid problems
with non-assertions normal exceptions still use the current output.
Change-Id: I7a2d9a8706eaac8bba5fa9c7a825893838d2a2aa
---
M tests/utils.py
1 file changed, 11 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py
index ae80633..c736f45 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -9,9 +9,11 @@
__version__ = '$Id$'
#
import os
+import re
import subprocess
import sys
import time
+import traceback
from warnings import warn
@@ -65,9 +67,17 @@
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
+ except AssertionError:
+ tb = traceback.extract_tb(sys.exc_info()[2])
+ for depth, line in enumerate(tb):
+ if re.match('^assert[A-Z]', line[2]):
+ break
+ tb = traceback.format_list(tb[:depth])
+ pywikibot.error('\n' + ''.join(tb)[:-1]) # remove \n at the end
+ raise unittest.SkipTest('Test is allowed to fail.')
except Exception:
pywikibot.exception(tb=True)
- raise unittest.SkipTest()
+ raise unittest.SkipTest('Test is allowed to fail.')
wrapper.__name__ = func.__name__
return wrapper
--
To view, visit https://gerrit.wikimedia.org/r/202010
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a2d9a8706eaac8bba5fa9c7a825893838d2a2aa
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Add messages for CFD template removal
......................................................................
Add messages for CFD template removal
Change-Id: Iba56f058ae0765270af9af12a6ef254d141ceea9
---
M category.py
M category/en.json
M category/qqq.json
3 files changed, 8 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/category.py b/category.py
index a8c5d92..c98a20d 100644
--- a/category.py
+++ b/category.py
@@ -2,6 +2,7 @@
"""i18n message bundle."""
msg = {
# Author: Xqt
+ # Author: Ben McIlwain (CydeWeys)
'en': {
'category-adding': u'Bot: Adding category [[:Category:%(newcat)s|%(newcat)s]]',
'category-also-in': u'(also in %(alsocat)s)',
@@ -13,6 +14,7 @@
'category-section-title': u'Page history of former %(oldcat)s',
'category-version-history': u'Bot: Saving version history of former %(oldcat)s',
'category-was-disbanded': u'Bot: Category was disbanded',
+ 'category-strip-cfd-templates': u'Bot: Removing CFD templates for completed action',
'category-was-moved': u'Bot: Category was moved to [[:Category:%(newcat)s|%(title)s]]',
},
# Author: Csisc
diff --git a/category/en.json b/category/en.json
index be386ae..28fd460 100644
--- a/category/en.json
+++ b/category/en.json
@@ -1,7 +1,8 @@
{
"@metadata": {
"authors": [
- "Xqt"
+ "Xqt",
+ "Ben McIlwain (CydeWeys)"
]
},
"category-version-history": "Bot: Saving version history of former %(oldcat)s",
@@ -9,6 +10,7 @@
"category-adding": "Bot: Adding category [[:Category:%(newcat)s|%(newcat)s]]",
"category-also-in": "(also in %(alsocat)s)",
"category-was-disbanded": "Bot: Category was disbanded",
+ "category-strip-cfd-templates": "Bot: Removing CFD templates for completed action",
"category-replacing": "Bot: Replacing category %(oldcat)s with %(newcat)s",
"category-removing": "Bot: Removing from %(oldcat)s",
"category-was-moved": "Bot: Category was moved to [[:Category:%(newcat)s|%(title)s]]",
diff --git a/category/qqq.json b/category/qqq.json
index 4563756..f8b1f75 100644
--- a/category/qqq.json
+++ b/category/qqq.json
@@ -7,7 +7,8 @@
"Shirayuki",
"Siebrand",
"Valhallasw",
- "Xqt"
+ "Xqt",
+ "Ben McIlwain (CydeWeys)"
]
},
"category-version-history": "Edit summary when the bot saves page' version history while category moving",
@@ -15,6 +16,7 @@
"category-adding": "{{doc-important|Do not change \":Category:%(newcat)s\" so this message will work in any language.}}",
"category-also-in": "Translations to say that the current category is in more categories than the one we are coming from",
"category-was-disbanded": "Used as reason for deletion of the category.",
+ "category-strip-cfd-templates": "Edit summary when CFD (Categories for deletion) templates are removed from the page's text following a move/keep action",
"category-replacing": "Edit summary. Parameters:\n* %(oldcat)s - old category name\n* %(newcat)s - new category name",
"category-removing": "Edit summary. Parameters:\n* %(oldcat)s - old category name",
"category-was-moved": "{{doc-important|Do not translate \"[[:Category:%(newcat)s|%(title)s]]\"}}",
--
To view, visit https://gerrit.wikimedia.org/r/205099
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iba56f058ae0765270af9af12a6ef254d141ceea9
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Owner: Cyde <cydeweys(a)gmail.com>
Gerrit-Reviewer: Cyde <cydeweys(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Krinkle <krinklemail(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
John Vandenberg has submitted this change and it was merged.
Change subject: Disambiguation page name show before alternatives
......................................................................
Disambiguation page name show before alternatives
When using -start, the script immediately shows a list of potential
alternative but user does not know which disambiguation page has been
parsed.
Output the disambiguation page name before listing alternatives:
Alternatives for [[fr:-]]
0 - Aide:Homonymie
1 - Signes plus et moins
2 - Tiret
3 - trait d'union
Change-Id: Ic35db186f1d74d8fe8b02caaab0de9921b28b85f
---
M scripts/solve_disambiguation.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 60d4149..d297680 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -1013,6 +1013,7 @@
if not self.findAlternatives(disambPage):
continue
+ pywikibot.output('\nAlternatives for %s' % disambPage)
self.makeAlternativesUnique()
# sort possible choices
if config.sort_ignore_case:
--
To view, visit https://gerrit.wikimedia.org/r/205021
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic35db186f1d74d8fe8b02caaab0de9921b28b85f
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
John Vandenberg has submitted this change and it was merged.
Change subject: scripts: set executable mode on all scripts
......................................................................
scripts: set executable mode on all scripts
In scripts and scripts/maintenance are python scripts meant to be run
from the command line. Set the executable bit on all of them beside the
__init__.py ones.
Change-Id: Ia43bdf76aeb90b59dad5c959cd2470328ac0ca68
---
M scripts/add_text.py
M scripts/archivebot.py
M scripts/blockreview.py
M scripts/capitalize_redirects.py
M scripts/casechecker.py
M scripts/cfd.py
M scripts/checkimages.py
M scripts/commons_link.py
M scripts/coordinate_import.py
M scripts/delete.py
M scripts/disambredir.py
M scripts/featured.py
M scripts/fixing_redirects.py
M scripts/flickrripper.py
M scripts/freebasemappingupload.py
M scripts/illustrate_wikidata.py
M scripts/image.py
M scripts/imagerecat.py
M scripts/imagetransfer.py
M scripts/listpages.py
M scripts/lonelypages.py
M scripts/maintenance/cache.py
M scripts/maintenance/compat2core.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/wikimedia_sites.py
M scripts/makecat.py
M scripts/match_images.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/newitem.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/patrol.py
M scripts/piper.py
M scripts/protect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/selflink.py
M scripts/shell.py
M scripts/solve_disambiguation.py
M scripts/states_redirect.py
M scripts/templatecount.py
M scripts/transferbot.py
M scripts/unusedfiles.py
M scripts/weblinkchecker.py
M scripts/welcome.py
48 files changed, 0 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py
old mode 100644
new mode 100755
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
old mode 100644
new mode 100755
diff --git a/scripts/blockreview.py b/scripts/blockreview.py
old mode 100644
new mode 100755
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py
old mode 100644
new mode 100755
diff --git a/scripts/casechecker.py b/scripts/casechecker.py
old mode 100644
new mode 100755
diff --git a/scripts/cfd.py b/scripts/cfd.py
old mode 100644
new mode 100755
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
old mode 100644
new mode 100755
diff --git a/scripts/commons_link.py b/scripts/commons_link.py
old mode 100644
new mode 100755
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
old mode 100644
new mode 100755
diff --git a/scripts/delete.py b/scripts/delete.py
old mode 100644
new mode 100755
diff --git a/scripts/disambredir.py b/scripts/disambredir.py
old mode 100644
new mode 100755
diff --git a/scripts/featured.py b/scripts/featured.py
old mode 100644
new mode 100755
diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py
old mode 100644
new mode 100755
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
old mode 100644
new mode 100755
diff --git a/scripts/freebasemappingupload.py b/scripts/freebasemappingupload.py
old mode 100644
new mode 100755
diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
old mode 100644
new mode 100755
diff --git a/scripts/image.py b/scripts/image.py
old mode 100644
new mode 100755
diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py
old mode 100644
new mode 100755
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
old mode 100644
new mode 100755
diff --git a/scripts/listpages.py b/scripts/listpages.py
old mode 100644
new mode 100755
diff --git a/scripts/lonelypages.py b/scripts/lonelypages.py
old mode 100644
new mode 100755
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
old mode 100644
new mode 100755
diff --git a/scripts/maintenance/compat2core.py b/scripts/maintenance/compat2core.py
old mode 100644
new mode 100755
diff --git a/scripts/maintenance/make_i18n_dict.py b/scripts/maintenance/make_i18n_dict.py
old mode 100644
new mode 100755
diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py
old mode 100644
new mode 100755
diff --git a/scripts/makecat.py b/scripts/makecat.py
old mode 100644
new mode 100755
diff --git a/scripts/match_images.py b/scripts/match_images.py
old mode 100644
new mode 100755
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
old mode 100644
new mode 100755
diff --git a/scripts/movepages.py b/scripts/movepages.py
old mode 100644
new mode 100755
diff --git a/scripts/newitem.py b/scripts/newitem.py
old mode 100644
new mode 100755
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
old mode 100644
new mode 100755
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
old mode 100644
new mode 100755
diff --git a/scripts/patrol.py b/scripts/patrol.py
old mode 100644
new mode 100755
diff --git a/scripts/piper.py b/scripts/piper.py
old mode 100644
new mode 100755
diff --git a/scripts/protect.py b/scripts/protect.py
old mode 100644
new mode 100755
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
old mode 100644
new mode 100755
diff --git a/scripts/replace.py b/scripts/replace.py
old mode 100644
new mode 100755
diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
old mode 100644
new mode 100755
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
old mode 100644
new mode 100755
diff --git a/scripts/selflink.py b/scripts/selflink.py
old mode 100644
new mode 100755
diff --git a/scripts/shell.py b/scripts/shell.py
old mode 100644
new mode 100755
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
old mode 100644
new mode 100755
diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py
old mode 100644
new mode 100755
diff --git a/scripts/templatecount.py b/scripts/templatecount.py
old mode 100644
new mode 100755
diff --git a/scripts/transferbot.py b/scripts/transferbot.py
old mode 100644
new mode 100755
diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
old mode 100644
new mode 100755
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
old mode 100644
new mode 100755
diff --git a/scripts/welcome.py b/scripts/welcome.py
old mode 100644
new mode 100755
--
To view, visit https://gerrit.wikimedia.org/r/205019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia43bdf76aeb90b59dad5c959cd2470328ac0ca68
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: scripts: add missing /usr/bin/python shebang
......................................................................
scripts: add missing /usr/bin/python shebang
A few scripts are missing the '#!/usr/bin/python'.
Change-Id: I59059c3092dd3e6c400870bb1ca4f0313985b532
---
M scripts/catall.py
M scripts/cfd.py
M scripts/create_categories.py
M scripts/delete.py
M scripts/image.py
M scripts/imagerecat.py
M scripts/imagetransfer.py
M scripts/listpages.py
M scripts/maintenance/cache.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/wikimedia_sites.py
M scripts/makecat.py
M scripts/misspelling.py
M scripts/protect.py
M scripts/reflinks.py
M scripts/watchlist.py
M scripts/weblinkchecker.py
M scripts/welcome.py
18 files changed, 18 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/catall.py b/scripts/catall.py
index c70ece8..9fd468c 100755
--- a/scripts/catall.py
+++ b/scripts/catall.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script shows the categories on each page and lets you change them.
diff --git a/scripts/cfd.py b/scripts/cfd.py
index 16d5c24..0922e32 100644
--- a/scripts/cfd.py
+++ b/scripts/cfd.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script processes the Categories for discussion working page.
diff --git a/scripts/create_categories.py b/scripts/create_categories.py
index ba5ab06..ac6f4e4 100755
--- a/scripts/create_categories.py
+++ b/scripts/create_categories.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Program to batch create categories.
diff --git a/scripts/delete.py b/scripts/delete.py
index 2b0ed2a..ed27a1e 100644
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used to delete and undelete pages en masse.
diff --git a/scripts/image.py b/scripts/image.py
index c66c586..512e863 100644
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used to change one image to another or remove an image.
diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py
index 73a60b3..d0e08d2 100644
--- a/scripts/imagerecat.py
+++ b/scripts/imagerecat.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Program to (re)categorize images at commons.
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
index 9592c60..1761790 100644
--- a/scripts/imagetransfer.py
+++ b/scripts/imagetransfer.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to copy images to Wikimedia Commons, or to another wiki.
diff --git a/scripts/listpages.py b/scripts/listpages.py
index 6c64157..c89be5a 100644
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
Print a list of pages, as defined by page generator parameters.
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 4a0d1d2..f05e9fd 100644
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
This script runs commands on each entry in the API caches.
diff --git a/scripts/maintenance/make_i18n_dict.py b/scripts/maintenance/make_i18n_dict.py
index c685618..bb6155f 100644
--- a/scripts/maintenance/make_i18n_dict.py
+++ b/scripts/maintenance/make_i18n_dict.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Generate a i18n file from a given script.
diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py
index 57b7e5e..ccd2417 100644
--- a/scripts/maintenance/wikimedia_sites.py
+++ b/scripts/maintenance/wikimedia_sites.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script that updates the language lists in Wikimedia family files."""
#
diff --git a/scripts/makecat.py b/scripts/makecat.py
index e1ca9b3..b2885f5 100644
--- a/scripts/makecat.py
+++ b/scripts/makecat.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
This bot takes as its argument the name of a new or existing category.
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index e0d7b36..6285bb2 100644
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script fixes links that contain common spelling mistakes.
diff --git a/scripts/protect.py b/scripts/protect.py
index 47b5bb2..ad8a147 100644
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used to protect and unprotect pages en masse.
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 79fbbd7..41f8fc9 100644
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Fetch and add titles for bare links in references.
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index 447858a..62770b4 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Allows access to the bot account's watchlist.
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 9faf7f9..175b8a2 100644
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This bot is used for checking external links found at the wiki.
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 16403be..65d0e67 100644
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# -*- coding: utf-8 -*-
u"""
Script to welcome new users.
--
To view, visit https://gerrit.wikimedia.org/r/205018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I59059c3092dd3e6c400870bb1ca4f0313985b532
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: jenkins-bot <>