id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
6,070,801 | __init__ | def __init__(self, config: Dict[str, Any] = {}, overrides: Dict[str, Any] = {}) -> None:
self.overrides = dict(overrides)
self.values = Config.config_values.copy()
self._raw_config = config
self.setup: Optional[Callable] = config.get('setup', None)
if 'extensions' in self.overri... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 150 | 161 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,802 | read | def read(
cls, confdir: str, overrides: Optional[Dict] = None, tags: Optional[Tags] = None
) -> "Config":
"""Create a Config object from configuration file."""
filename = path.join(confdir, CONFIG_FILENAME)
if not path.isfile(filename):
raise ConfigError(__("config direct... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 164 | 184 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,803 | convert_overrides | def convert_overrides(self, name: str, value: Any) -> Any:
if not isinstance(value, str):
return value
else:
defvalue = self.values[name][0]
if self.values[name][2] == Any:
return value
elif self.values[name][2] == {bool, str}:
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 186 | 225 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,804 | pre_init_values | def pre_init_values(self) -> None:
"""
Initialize some limited config variables before initializing i18n and loading
extensions.
"""
variables = ['needs_sphinx', 'suppress_warnings', 'language', 'locale_dirs']
for name in variables:
try:
if nam... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 227 | 240 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,805 | init_values | def init_values(self) -> None:
config = self._raw_config
for valname, value in self.overrides.items():
try:
if '.' in valname:
realvalname, key = valname.split('.', 1)
config.setdefault(realvalname, {})[key] = value
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 242 | 262 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,806 | post_init_values | def post_init_values(self) -> None:
"""
Initialize additional config variables that are added after init_values() called.
"""
config = self._raw_config
for name in config:
if name not in self.__dict__ and name in self.values:
self.__dict__[name] = conf... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 264 | 273 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,807 | __getattr__ | def __getattr__(self, name: str) -> Any:
if name.startswith('_'):
raise AttributeError(name)
if name not in self.values:
raise AttributeError(__('No such config value: %s') % name)
default = self.values[name][0]
if callable(default):
return default(sel... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 275 | 283 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,808 | __getitem__ | def __getitem__(self, name: str) -> Any:
return getattr(self, name) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 285 | 286 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,809 | __setitem__ | def __setitem__(self, name: str, value: Any) -> None:
setattr(self, name, value) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 288 | 289 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,810 | __delitem__ | def __delitem__(self, name: str) -> None:
delattr(self, name) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 291 | 292 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,811 | __contains__ | def __contains__(self, name: str) -> bool:
return name in self.values | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 294 | 295 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,812 | __iter__ | def __iter__(self) -> Generator[ConfigValue, None, None]:
for name, value in self.values.items():
yield ConfigValue(name, getattr(self, name), value[1]) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 297 | 299 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,813 | add | def add(self, name: str, default: Any, rebuild: Union[bool, str], types: Any) -> None:
if name in self.values:
raise ExtensionError(__('Config value %r already present') % name)
else:
self.values[name] = (default, rebuild, types) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 301 | 305 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,814 | filter | def filter(self, rebuild: Union[str, List[str]]) -> Iterator[ConfigValue]:
if isinstance(rebuild, str):
rebuild = [rebuild]
return (value for value in self if value.rebuild in rebuild) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 307 | 310 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,815 | __getstate__ | def __getstate__(self) -> Dict:
"""Obtains serializable data for pickling."""
# remove potentially pickling-problematic values from config
__dict__ = {}
for key, value in self.__dict__.items():
if key.startswith('_') or not is_serializable(value):
pass
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 312 | 333 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,816 | __setstate__ | def __setstate__(self, state: Dict) -> None:
self.__dict__.update(state) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 335 | 336 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,817 | eval_config_file | def eval_config_file(filename: str, tags: Optional[Tags]) -> Dict[str, Any]:
"""Evaluate a config file."""
namespace: Dict[str, Any] = {}
namespace['__file__'] = filename
namespace['tags'] = tags
with cd(path.dirname(filename)):
# during executing config file, current dir is changed to ``co... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 339 | 365 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,818 | convert_source_suffix | def convert_source_suffix(app: "Sphinx", config: Config) -> None:
"""Convert old styled source_suffix to new styled one.
* old style: str or list
* new style: a dict which maps from fileext to filetype
"""
source_suffix = config.source_suffix
if isinstance(source_suffix, str):
# if str,... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 368 | 390 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,819 | convert_highlight_options | def convert_highlight_options(app: "Sphinx", config: Config) -> None:
"""Convert old styled highlight_options to new styled one.
* old style: options
* new style: a dict which maps from language name to options
"""
options = config.highlight_options
if options and not all(isinstance(v, dict) fo... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 393 | 402 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,820 | init_numfig_format | def init_numfig_format(app: "Sphinx", config: Config) -> None:
"""Initialize :confval:`numfig_format`."""
numfig_format = {'section': _('Section %s'),
'figure': _('Fig. %s'),
'table': _('Table %s'),
'code-block': _('Listing %s')}
# override def... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 405 | 414 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,821 | correct_copyright_year | def correct_copyright_year(app: "Sphinx", config: Config) -> None:
"""Correct values of copyright year that are not coherent with
the SOURCE_DATE_EPOCH environment variable (if set)
See https://reproducible-builds.org/specs/source-date-epoch/
"""
if getenv('SOURCE_DATE_EPOCH') is not None:
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 417 | 427 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,822 | check_confval_types | def check_confval_types(app: Optional["Sphinx"], config: Config) -> None:
"""Check all values for deviation from the default value's type, since
that can result in TypeErrors all over the place NB.
"""
for confval in config:
default, rebuild, annotations = config.values[confval.name]
if... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 430 | 482 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,823 | check_primary_domain | def check_primary_domain(app: "Sphinx", config: Config) -> None:
primary_domain = config.primary_domain
if primary_domain and not app.registry.has_domain(primary_domain):
logger.warning(__('primary_domain %r not found, ignored.'), primary_domain)
config.primary_domain = None # type: ignore | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 485 | 489 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,824 | check_root_doc | def check_root_doc(app: "Sphinx", env: "BuildEnvironment", added: Set[str],
changed: Set[str], removed: Set[str]) -> Set[str]:
"""Adjust root_doc to 'contents' to support an old project which does not have
any root_doc setting.
"""
if (app.config.root_doc == 'index' and
'i... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 492 | 504 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,825 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.connect('config-inited', convert_source_suffix, priority=800)
app.connect('config-inited', convert_highlight_options, priority=800)
app.connect('config-inited', init_numfig_format, priority=800)
app.connect('config-inited', correct_copyright_year, priority... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/config.py | 507 | 520 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,826 | __init__ | def __init__(self, fix_parens: bool = False, lowercase: bool = False,
nodeclass: Optional[Type[Element]] = None,
innernodeclass: Optional[Type[TextElement]] = None,
warn_dangling: bool = False) -> None:
self.fix_parens = fix_parens
self.lowercase = lowe... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 66 | 78 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,827 | update_title_and_target | def update_title_and_target(self, title: str, target: str) -> Tuple[str, str]:
if not self.has_explicit_title:
if title.endswith('()'):
# remove parentheses
title = title[:-2]
if self.config.add_function_parentheses:
# add them back to all ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 80 | 91 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,828 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
if ':' not in self.name:
self.refdomain, self.reftype = '', self.name
self.classes = ['xref', self.reftype]
else:
self.refdomain, self.reftype = self.name.split(':', 1)
self.classes = ['xref', self.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 93 | 104 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,829 | create_non_xref_node | def create_non_xref_node(self) -> Tuple[List[Node], List[system_message]]:
text = utils.unescape(self.text[1:])
if self.fix_parens:
self.has_explicit_title = False # treat as implicit
text, target = self.update_title_and_target(text, "")
node = self.innernodeclass(self.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 106 | 113 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,830 | create_xref_node | def create_xref_node(self) -> Tuple[List[Node], List[system_message]]:
target = self.target
title = self.title
if self.lowercase:
target = target.lower()
if self.fix_parens:
title, target = self.update_title_and_target(title, target)
# create the referenc... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 115 | 138 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,831 | process_link | def process_link(self, env: "BuildEnvironment", refnode: Element, has_explicit_title: bool,
title: str, target: str) -> Tuple[str, str]:
"""Called after parsing title and target text, and creating the
reference node (given in *refnode*). This method can alter the
reference ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 142 | 149 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,832 | result_nodes | def result_nodes(self, document: nodes.document, env: "BuildEnvironment", node: Element,
is_ref: bool) -> Tuple[List[Node], List[system_message]]:
"""Called before returning the finished nodes. *node* is the reference
node if one was created (*is_ref* is then true), else the conten... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 151 | 158 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,833 | process_link | def process_link(self, env: "BuildEnvironment", refnode: Element, has_explicit_title: bool,
title: str, target: str) -> Tuple[str, str]:
result = super().process_link(env, refnode, has_explicit_title, title, target)
# add all possible context info (i.e. std:program, py:module etc.)
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 162 | 167 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,834 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
target_id = 'index-%s' % self.env.new_serialno('index')
entries = [('single', _('Python Enhancement Proposals; PEP %s') % self.target,
target_id, '', None)]
index = addnodes.index(entries=entries)
target = nod... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 171 | 194 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,835 | build_uri | def build_uri(self) -> str:
base_url = self.inliner.document.settings.pep_base_url
ret = self.target.split('#', 1)
if len(ret) == 2:
return base_url + 'pep-%04d/#%s' % (int(ret[0]), ret[1])
else:
return base_url + 'pep-%04d/' % int(ret[0]) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 196 | 202 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,836 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
target_id = 'index-%s' % self.env.new_serialno('index')
entries = [('single', 'RFC; RFC %s' % self.target, target_id, '', None)]
index = addnodes.index(entries=entries)
target = nodes.target('', '', ids=[target_id])
self.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 206 | 228 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,837 | build_uri | def build_uri(self) -> str:
base_url = self.inliner.document.settings.rfc_base_url
ret = self.target.split('#', 1)
if len(ret) == 2:
return base_url + self.inliner.rfc_url % int(ret[0]) + '#' + ret[1]
else:
return base_url + self.inliner.rfc_url % int(ret[0]) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 230 | 236 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,838 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
node = nodes.inline(rawtext=self.rawtext, classes=[self.name])
spans = self.amp_re.split(self.text)
node += nodes.Text(spans.pop(0))
for span in spans:
span = span.replace('&&', '&')
letter = nodes.Text(sp... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 245 | 257 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,839 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
self.text = self.text.replace('-->', self.BULLET_CHARACTER)
return super().run() | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 263 | 265 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,840 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
children = self.parse(self.text)
node = nodes.literal(self.rawtext, '', *children,
role=self.name.lower(), classes=[self.name])
return [node], [] | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 275 | 280 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,841 | parse | def parse(self, text: str) -> List[Node]:
result: List[Node] = []
stack = ['']
for part in self.parens_re.split(text):
if part == '\\\\': # escaped backslash
stack[-1] += '\\'
elif part == '{':
if len(stack) >= 2 and stack[-2] == "{": # ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 282 | 319 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,842 | run | def run(self) -> Tuple[List[Node], List[system_message]]:
options = self.options.copy()
matched = self.abbr_re.search(self.text)
if matched:
text = self.text[:matched.start()].strip()
options['explanation'] = matched.group(1)
else:
text = self.text
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 328 | 337 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,843 | code_role | def code_role(name: str, rawtext: str, text: str, lineno: int,
inliner: docutils.parsers.rst.states.Inliner,
options: Dict = {}, content: List[str] = []
) -> Tuple[List[Node], List[system_message]]:
options = options.copy()
docutils.parsers.rst.roles.set_classes(options... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 364 | 382 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,844 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
from docutils.parsers.rst import roles
for rolename, nodeclass in generic_docroles.items():
generic = roles.GenericRole(rolename, nodeclass)
role = roles.CustomRole(rolename, generic, {'classes': [rolename]})
roles.register_local_role(rolename... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/roles.py | 407 | 426 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,845 | deprecated_alias | def deprecated_alias(modname: str, objects: Dict[str, object],
warning: Type[Warning], names: Dict[str, str] = {}) -> None:
module = import_module(modname)
sys.modules[modname] = _ModuleWrapper( # type: ignore
module, modname, objects, warning, names) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 20 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,846 | __init__ | def __init__(self, module: Any, modname: str,
objects: Dict[str, object],
warning: Type[Warning],
names: Dict[str, str]) -> None:
self._module = module
self._modname = modname
self._objects = objects
self._warning = warning
self.... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 28 | 36 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,847 | __getattr__ | def __getattr__(self, name: str) -> Any:
if name not in self._objects:
return getattr(self._module, name)
canonical_name = self._names.get(name, None)
if canonical_name is not None:
warnings.warn(
"The alias '{}.{}' is deprecated, use '{}' instead. Check ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 38 | 52 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,848 | __init__ | def __init__(self, data: Dict[str, Any], message: str, warning: Type[Warning]) -> None:
self.message = message
self.warning = warning
super().__init__(data) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 58 | 61 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,849 | __setitem__ | def __setitem__(self, key: str, value: Any) -> None:
warnings.warn(self.message, self.warning, stacklevel=2)
super().__setitem__(key, value) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 63 | 65 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,850 | setdefault | def setdefault(self, key: str, default: Any = None) -> Any:
warnings.warn(self.message, self.warning, stacklevel=2)
return super().setdefault(key, default) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 67 | 69 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,851 | __getitem__ | def __getitem__(self, key: str) -> Any:
warnings.warn(self.message, self.warning, stacklevel=2)
return super().__getitem__(key) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 71 | 73 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,852 | get | def get(self, key: str, default: Any = None) -> Any:
warnings.warn(self.message, self.warning, stacklevel=2)
return super().get(key, default) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 75 | 77 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,853 | update | def update(self, other: Dict[str, Any]) -> None: # type: ignore
warnings.warn(self.message, self.warning, stacklevel=2)
super().update(other) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/deprecation.py | 79 | 81 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,854 | __init__ | def __init__(self) -> None:
#: special attrgetter for autodoc; class object -> attrgetter
self.autodoc_attrgettrs: Dict[Type, Callable[[Any, str, Any], Any]] = {}
#: builders; a dict of builder name -> bulider class
self.builders: Dict[str, Type[Builder]] = {}
#: autodoc docume... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 53 | 131 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,855 | add_builder | def add_builder(self, builder: Type[Builder], override: bool = False) -> None:
logger.debug('[app] adding builder: %r', builder)
if not hasattr(builder, 'name'):
raise ExtensionError(__('Builder class %s has no "name" attribute') % builder)
if builder.name in self.builders and not ov... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 133 | 140 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,856 | preload_builder | def preload_builder(self, app: "Sphinx", name: str) -> None:
if name is None:
return
if name not in self.builders:
builder_entry_points = entry_points(group='sphinx.builders')
try:
entry_point = builder_entry_points[name]
except KeyError a... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 142 | 154 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,857 | create_builder | def create_builder(self, app: "Sphinx", name: str,
env: Optional[BuildEnvironment] = None) -> Builder:
if name not in self.builders:
raise SphinxError(__('Builder name %s not registered') % name)
try:
return self.builders[name](app, env)
except Typ... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 156 | 172 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,858 | add_domain | def add_domain(self, domain: Type[Domain], override: bool = False) -> None:
logger.debug('[app] adding domain: %r', domain)
if domain.name in self.domains and not override:
raise ExtensionError(__('domain %s already registered') % domain.name)
self.domains[domain.name] = domain | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 174 | 178 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,859 | has_domain | def has_domain(self, domain: str) -> bool:
return domain in self.domains | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 180 | 181 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,860 | create_domains | def create_domains(self, env: BuildEnvironment) -> Iterator[Domain]:
for DomainClass in self.domains.values():
domain = DomainClass(env)
# transplant components added by extensions
domain.directives.update(self.domain_directives.get(domain.name, {}))
domain.roles... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 183 | 194 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,861 | add_directive_to_domain | def add_directive_to_domain(self, domain: str, name: str,
cls: Type[Directive], override: bool = False) -> None:
logger.debug('[app] adding directive to domain: %r', (domain, name, cls))
if domain not in self.domains:
raise ExtensionError(__('domain %s not yet... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 196 | 206 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,862 | add_role_to_domain | def add_role_to_domain(self, domain: str, name: str,
role: Union[RoleFunction, XRefRole], override: bool = False
) -> None:
logger.debug('[app] adding role to domain: %r', (domain, name, role))
if domain not in self.domains:
raise Extensi... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 208 | 218 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,863 | add_index_to_domain | def add_index_to_domain(self, domain: str, index: Type[Index],
override: bool = False) -> None:
logger.debug('[app] adding index to domain: %r', (domain, index))
if domain not in self.domains:
raise ExtensionError(__('domain %s not yet registered') % domain)
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 220 | 229 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,864 | add_object_type | def add_object_type(
self,
directivename: str,
rolename: str,
indextemplate: str = '',
parse_node: Optional[Callable] = None,
ref_nodeclass: Optional[Type[TextElement]] = None,
objname: str = '',
doc_field_types: List = [],
override: bool = False
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 231 | 260 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,865 | add_crossref_type | def add_crossref_type(
self,
directivename: str,
rolename: str,
indextemplate: str = '',
ref_nodeclass: Optional[Type[TextElement]] = None,
objname: str = '',
override: bool = False
) -> None:
logger.debug('[app] adding crossref type: %r',
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 262 | 286 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,866 | add_source_suffix | def add_source_suffix(self, suffix: str, filetype: str, override: bool = False) -> None:
logger.debug('[app] adding source_suffix: %r, %r', suffix, filetype)
if suffix in self.source_suffix and not override:
raise ExtensionError(__('source_suffix %r is already registered') % suffix)
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 288 | 293 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,867 | add_source_parser | def add_source_parser(self, parser: Type[Parser], override: bool = False) -> None:
logger.debug('[app] adding search source_parser: %r', parser)
# create a map from filetype to parser
for filetype in parser.supported:
if filetype in self.source_parsers and not override:
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 295 | 304 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,868 | get_source_parser | def get_source_parser(self, filetype: str) -> Type[Parser]:
try:
return self.source_parsers[filetype]
except KeyError as exc:
raise SphinxError(__('Source parser for %s not registered') % filetype) from exc | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 306 | 310 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,869 | get_source_parsers | def get_source_parsers(self) -> Dict[str, Type[Parser]]:
return self.source_parsers | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 312 | 313 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,870 | create_source_parser | def create_source_parser(self, app: "Sphinx", filename: str) -> Parser:
parser_class = self.get_source_parser(filename)
parser = parser_class()
if isinstance(parser, SphinxParser):
parser.set_application(app)
return parser | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 315 | 320 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,871 | get_source_input | def get_source_input(self, filetype: str) -> Optional[Type[Input]]:
warnings.warn('SphinxComponentRegistry.get_source_input() is deprecated.',
RemovedInSphinx60Warning)
try:
return self.source_inputs[filetype]
except KeyError:
try:
#... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 322 | 333 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,872 | add_translator | def add_translator(self, name: str, translator: Type[nodes.NodeVisitor],
override: bool = False) -> None:
logger.debug('[app] Change of translator for the %s builder.', name)
if name in self.translators and not override:
raise ExtensionError(__('Translator for %r alrea... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 335 | 340 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,873 | add_translation_handlers | def add_translation_handlers(self, node: Type[Element],
**kwargs: Tuple[Callable, Callable]) -> None:
logger.debug('[app] adding translation_handlers: %r, %r', node, kwargs)
for builder_name, handlers in kwargs.items():
translation_handlers = self.translation... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 342 | 354 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,874 | get_translator_class | def get_translator_class(self, builder: Builder) -> Type[nodes.NodeVisitor]:
return self.translators.get(builder.name,
builder.default_translator_class) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 356 | 358 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,875 | create_translator | def create_translator(self, builder: Builder, *args: Any) -> nodes.NodeVisitor:
translator_class = self.get_translator_class(builder)
assert translator_class, "translator not found for %s" % builder.name
translator = translator_class(*args)
# transplant handlers for custom nodes to tran... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 360 | 376 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,876 | add_transform | def add_transform(self, transform: Type[Transform]) -> None:
logger.debug('[app] adding transform: %r', transform)
self.transforms.append(transform) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 378 | 380 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,877 | get_transforms | def get_transforms(self) -> List[Type[Transform]]:
return self.transforms | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 382 | 383 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,878 | add_post_transform | def add_post_transform(self, transform: Type[Transform]) -> None:
logger.debug('[app] adding post transform: %r', transform)
self.post_transforms.append(transform) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 385 | 387 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,879 | get_post_transforms | def get_post_transforms(self) -> List[Type[Transform]]:
return self.post_transforms | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 389 | 390 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,880 | add_documenter | def add_documenter(self, objtype: str, documenter: Type["Documenter"]) -> None:
self.documenters[objtype] = documenter | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 392 | 393 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,881 | add_autodoc_attrgetter | def add_autodoc_attrgetter(self, typ: Type,
attrgetter: Callable[[Any, str, Any], Any]) -> None:
self.autodoc_attrgettrs[typ] = attrgetter | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 395 | 397 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,882 | add_css_files | def add_css_files(self, filename: str, **attributes: Any) -> None:
self.css_files.append((filename, attributes)) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 399 | 400 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,883 | add_js_file | def add_js_file(self, filename: str, **attributes: Any) -> None:
logger.debug('[app] adding js_file: %r, %r', filename, attributes)
self.js_files.append((filename, attributes)) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 402 | 404 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,884 | has_latex_package | def has_latex_package(self, name: str) -> bool:
packages = self.latex_packages + self.latex_packages_after_hyperref
return bool([x for x in packages if x[0] == name]) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 406 | 408 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,885 | add_latex_package | def add_latex_package(self, name: str, options: str, after_hyperref: bool = False) -> None:
if self.has_latex_package(name):
logger.warning("latex package '%s' already included", name)
logger.debug('[app] adding latex package: %r', name)
if after_hyperref:
self.latex_pac... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 410 | 418 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,886 | add_enumerable_node | def add_enumerable_node(
self,
node: Type[Node],
figtype: str,
title_getter: Optional[TitleGetter] = None, override: bool = False
) -> None:
logger.debug('[app] adding enumerable node: (%r, %r, %r)', node, figtype, title_getter)
if node in self.enumerable_nodes and no... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 420 | 429 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,887 | add_html_math_renderer | def add_html_math_renderer(self, name: str,
inline_renderers: Tuple[Callable, Callable],
block_renderers: Tuple[Callable, Callable]) -> None:
logger.debug('[app] adding html_math_renderer: %s, %r, %r',
name, inline_renderers, blo... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 431 | 440 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,888 | add_html_theme | def add_html_theme(self, name: str, theme_path: str) -> None:
self.html_themes[name] = theme_path | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 442 | 443 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,889 | load_extension | def load_extension(self, app: "Sphinx", extname: str) -> None:
"""Load a Sphinx extension."""
if extname in app.extensions: # already loaded
return
if extname in EXTENSION_BLACKLIST:
logger.warning(__('the extension %r was already merged with Sphinx since '
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 445 | 489 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,890 | get_envversion | def get_envversion(self, app: "Sphinx") -> Dict[str, str]:
from sphinx.environment import ENV_VERSION
envversion = {ext.name: ext.metadata['env_version'] for ext in app.extensions.values()
if ext.metadata.get('env_version')}
envversion['sphinx'] = ENV_VERSION
return... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 491 | 496 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,891 | get_publisher | def get_publisher(self, app: "Sphinx", filetype: str) -> Publisher:
try:
return self.publishers[filetype]
except KeyError:
pass
publisher = create_publisher(app, filetype)
self.publishers[filetype] = publisher
return publisher | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 498 | 505 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,892 | merge_source_suffix | def merge_source_suffix(app: "Sphinx", config: Config) -> None:
"""Merge any user-specified source_suffix with any added by extensions."""
for suffix, filetype in app.registry.source_suffix.items():
if suffix not in app.config.source_suffix:
app.config.source_suffix[suffix] = filetype
... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 508 | 519 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,893 | setup | def setup(app: "Sphinx") -> Dict[str, Any]:
app.connect('config-inited', merge_source_suffix, priority=800)
return {
'version': 'builtin',
'parallel_read_safe': True,
'parallel_write_safe': True,
} | python | python-3.10.8.amd64/Lib/site-packages/sphinx/registry.py | 522 | 529 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,894 | __init__ | def __init__(self, app: "Sphinx") -> None:
self.app = app
self.events = core_events.copy()
self.listeners: Dict[str, List[EventListener]] = defaultdict(list)
self.next_listener_id = 0 | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 51 | 55 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,895 | add | def add(self, name: str) -> None:
"""Register a custom Sphinx event."""
if name in self.events:
raise ExtensionError(__('Event %r already present') % name)
self.events[name] = '' | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 57 | 61 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,896 | connect | def connect(self, name: str, callback: Callable, priority: int) -> int:
"""Connect a handler to specific event."""
if name not in self.events:
raise ExtensionError(__('Unknown event name: %s') % name)
listener_id = self.next_listener_id
self.next_listener_id += 1
sel... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 63 | 71 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,897 | disconnect | def disconnect(self, listener_id: int) -> None:
"""Disconnect a handler."""
for listeners in self.listeners.values():
for listener in listeners[:]:
if listener.id == listener_id:
listeners.remove(listener) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 73 | 78 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,898 | emit | def emit(self, name: str, *args: Any,
allowed_exceptions: Tuple[Type[Exception], ...] = ()) -> List:
"""Emit a Sphinx event."""
try:
logger.debug('[app] emitting event: %r%s', name, repr(args)[:100])
except Exception:
# not every object likes to be repr()'d (... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 80 | 107 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,899 | emit_firstresult | def emit_firstresult(self, name: str, *args: Any,
allowed_exceptions: Tuple[Type[Exception], ...] = ()) -> Any:
"""Emit a Sphinx event and returns first result.
This returns the result of the first handler that doesn't return ``None``.
"""
for result in self.emi... | python | python-3.10.8.amd64/Lib/site-packages/sphinx/events.py | 109 | 118 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,070,900 | __init__ | def __init__(self, *args: Any, **kwargs: Any) -> None:
from sphinx.application import Sphinx
if len(args) > 0 and isinstance(args[0], Sphinx):
self._app = args[0]
self._env = self._app.env
args = args[1:]
super().__init__(*args, **kwargs) | python | python-3.10.8.amd64/Lib/site-packages/sphinx/io.py | 46 | 53 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.