mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-02-26 22:19:15 +01:00
Replaced regex with re in info plugin
This commit is contained in:
parent
396c493f47
commit
37162a57cd
@ -23,7 +23,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import regex
|
import re
|
||||||
import requests
|
import requests
|
||||||
import site
|
import site
|
||||||
import sys
|
import sys
|
||||||
@ -408,9 +408,8 @@ class InfoPlugin(BasePlugin[InfoConfig]):
|
|||||||
|
|
||||||
# Resolve the path into POSIX format to match the patterns
|
# Resolve the path into POSIX format to match the patterns
|
||||||
pattern_path = _resolve_pattern(abspath, return_path = True)
|
pattern_path = _resolve_pattern(abspath, return_path = True)
|
||||||
|
|
||||||
for pattern in self.exclusion_patterns:
|
for pattern in self.exclusion_patterns:
|
||||||
if regex.search(pattern, pattern_path):
|
if re.search(pattern, pattern_path):
|
||||||
log.debug(f"Excluded pattern '{pattern}': {abspath}")
|
log.debug(f"Excluded pattern '{pattern}': {abspath}")
|
||||||
self.excluded_entries.append(f"{pattern} - {pattern_path}")
|
self.excluded_entries.append(f"{pattern} - {pattern_path}")
|
||||||
return True
|
return True
|
||||||
|
@ -23,7 +23,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import regex
|
import re
|
||||||
import requests
|
import requests
|
||||||
import site
|
import site
|
||||||
import sys
|
import sys
|
||||||
@ -408,9 +408,8 @@ class InfoPlugin(BasePlugin[InfoConfig]):
|
|||||||
|
|
||||||
# Resolve the path into POSIX format to match the patterns
|
# Resolve the path into POSIX format to match the patterns
|
||||||
pattern_path = _resolve_pattern(abspath, return_path = True)
|
pattern_path = _resolve_pattern(abspath, return_path = True)
|
||||||
|
|
||||||
for pattern in self.exclusion_patterns:
|
for pattern in self.exclusion_patterns:
|
||||||
if regex.search(pattern, pattern_path):
|
if re.search(pattern, pattern_path):
|
||||||
log.debug(f"Excluded pattern '{pattern}': {abspath}")
|
log.debug(f"Excluded pattern '{pattern}': {abspath}")
|
||||||
self.excluded_entries.append(f"{pattern} - {pattern_path}")
|
self.excluded_entries.append(f"{pattern} - {pattern_path}")
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user