1072 if replacement_set:
1073 replacements.extend(replacement_set)
1074 if replacement_set._exceptions is not None:
1075 for k, v in replacement_set._exceptions.items():1076 if k in exceptions:
1077 exceptions[k] = list(set(exceptions[k]) | set(v))
1078 else:
1071 # Exceptions specified via 'fix' shall be merged to those via CLI.
1072 if replacement_set:
1073 replacements.extend(replacement_set)
1074 if replacement_set._exceptions is not None:1075 for k, v in replacement_set._exceptions.items():
1076 if k in exceptions:
1077 exceptions[k] = list(set(exceptions[k]) | set(v))
383 def _compile(self, use_regex, flags) -> None:
384 """Compile the search regex and the fix's exceptions."""
385 super()._compile(use_regex, flags)
386 self.fix_set._compile_exceptions(use_regex, flags) 387
388 def get_inside_exceptions(self):
389 """Get exceptions on text (inside exceptions)."""
153 site = pywikibot.Site()
154 specialpages = site.siteinfo['specialpagealiases']
155 specialpagelist = {item['realname'] for item in specialpages}
156 allowedlanguages = site._paraminfo.parameter(module='setpagelanguage',157 param_name='lang')['type']
158 # Check if the special page PageLanguage is enabled on the wiki
159 # If it is not, page languages can't be set, and there's no point in
2758 ptype, level = d.popitem()
2759 if level:
2760 protection[ptype] = (level, expiry)
2761 page._protection = protection2762 finally:
2763 self.unlock_page(page)
2764
Accessing a protected member (a member prefixed with _
) of a class from outside that class is not recommended, since the creator of that class did not intend this member to be exposed. If accesing this attribute outside of the class is absolutely needed, refactor it such that it becomes part of the public interface of the class.
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
r = Rectangle(4, 8)
area = r._height * r._width
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
def area():
return self._height * self._width
r = Rectangle(4, 8)
area = r.area()