jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/508077 )
Change subject: Remove caret from re.match ......................................................................
Remove caret from re.match
Change-Id: I15f533f78afbdc03040483f40e02511c1cf97e09 --- M pywikibot/date.py M pywikibot/site.py M pywikibot/tools/__init__.py M scripts/casechecker.py M scripts/reflinks.py M scripts/upload.py 6 files changed, 7 insertions(+), 7 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, but someone else must approve D3r1ck01: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py index aecefd1..efa0609 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -372,7 +372,7 @@ Returns a compiled regex object and a list of digit decoders. """ if pattern not in _escPtrnCache2: - newPattern = '^' # beginning of the string + newPattern = '' # match starts at the beginning of the string strPattern = '' decoders = [] for s in _reParameters.split(pattern): diff --git a/pywikibot/site.py b/pywikibot/site.py index 59da8df..6ff1b62 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1392,7 +1392,7 @@ All values of the siteinfo property 'general' are directly available. """
- WARNING_REGEX = re.compile(r'^Unrecognized values? for parameter ' + WARNING_REGEX = re.compile(r'Unrecognized values? for parameter ' r'["']siprop["']: (.+?).?$')
# Until we get formatversion=2, we have to convert empty-string properties @@ -2964,7 +2964,7 @@ try: versionstring = self.siteinfo.get('generator', expiry=0 if force else 1) - m = re.match(r'^MediaWiki ([0-9]+).([0-9]+)(.*)$', versionstring) + m = re.match(r'MediaWiki ([0-9]+).([0-9]+)(.*)$', versionstring) if m: return (int(m.group(1)), int(m.group(2)), m.group(3)) # May occur if you are not logged in (no API read permissions). diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index 8bd43d5..52d4610 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -730,7 +730,7 @@ """
MEDIAWIKI_VERSION = re.compile( - r'^(\d+(?:.\d+)+)(-?wmf.?(\d+)|alpha|beta(\d+)|-?rc.?(\d+)|.*)?$') + r'(\d+(?:.\d+)+)(-?wmf.?(\d+)|alpha|beta(\d+)|-?rc.?(\d+)|.*)?$')
@classmethod def from_generator(cls, generator): diff --git a/scripts/casechecker.py b/scripts/casechecker.py index 08bd2f4..d49b50e 100755 --- a/scripts/casechecker.py +++ b/scripts/casechecker.py @@ -53,7 +53,7 @@ # all letters that may be used as suffixes after roman numbers: "Iый" romannumSuffixes = localLowerLtr romanNumSfxPtrn = re.compile( - '^[' + romanNumChars + ']+[' + localLowerLtr + ']+$') + '[{}]+[{}]+$'.format(romanNumChars, localLowerLtr))
whitelists = { 'ru': 'ВП:КЛ/Проверенные', diff --git a/scripts/reflinks.py b/scripts/reflinks.py index 97fdba5..cc23e09 100755 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -119,7 +119,7 @@ re.IGNORECASE) # matches an URL at the index of a website dirIndex = re.compile( - r'^\w+://[^/]+/((default|index).' + r'\w+://[^/]+/((default|index).' r'(asp|aspx|cgi|htm|html|phtml|mpx|mspx|php|shtml|var))?$', re.IGNORECASE) # Extracts the domain name diff --git a/scripts/upload.py b/scripts/upload.py index 723ac05..79db797 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -69,7 +69,7 @@
CHUNK_SIZE_REGEX = re.compile( - r'^-chunked(?::(\d+(?:.\d+)?)[ \t]*(k|ki|m|mi)?b?)?$', re.I) + r'-chunked(?::(\d+(?:.\d+)?)[ \t]*(k|ki|m|mi)?b?)?$', re.I)
def get_chunk_size(match):
pywikibot-commits@lists.wikimedia.org