diff options
| author | yum <yum.food.vr@gmail.com> | 2022-12-17 17:26:16 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2022-12-17 17:26:16 -0800 |
| commit | 4d836989720523cd0363927e3e066f56b9dc445c (patch) | |
| tree | f7a9ff7cb50eda1ff29e91c78067dcc5e0ce6233 /Python/Dependencies/future-0.18.2/docs/futureext.py | |
| parent | da754e9cf5b192239826aa1619e1ada3c98daa45 (diff) | |
Check in `future` package
I hit some issues installing Whisper and had to embed this package.
I haven't taken the time to deeply understand what's going on. I think
that embedded Python follows different rules about resolving module
paths than regular system Python.
Basically, `future`'s setup.py has a line like `import src`, where
`src` is a module inside future (like `future/src/__init__.py`). This
doesn't work unless we put that directory on the search path.
Diffstat (limited to 'Python/Dependencies/future-0.18.2/docs/futureext.py')
| -rw-r--r-- | Python/Dependencies/future-0.18.2/docs/futureext.py | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Python/Dependencies/future-0.18.2/docs/futureext.py b/Python/Dependencies/future-0.18.2/docs/futureext.py new file mode 100644 index 0000000..23471a1 --- /dev/null +++ b/Python/Dependencies/future-0.18.2/docs/futureext.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" + Python-Future Documentation Extensions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Support for automatically documenting filters and tests. + + Based on the Jinja2 documentation extensions. + + :copyright: Copyright 2008 by Armin Ronacher. + :license: BSD. +""" +import collections +import os +import re +import inspect +from itertools import islice +from types import BuiltinFunctionType +from docutils import nodes +from docutils.statemachine import ViewList +from sphinx.ext.autodoc import prepare_docstring +from sphinx.application import TemplateBridge +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic + + +def parse_rst(state, content_offset, doc): + node = nodes.section() + # hack around title style bookkeeping + surrounding_title_styles = state.memo.title_styles + surrounding_section_level = state.memo.section_level + state.memo.title_styles = [] + state.memo.section_level = 0 + state.nested_parse(doc, content_offset, node, match_titles=1) + state.memo.title_styles = surrounding_title_styles + state.memo.section_level = surrounding_section_level + return node.children + + +class FutureStyle(Style): + title = 'Future Style' + default_style = "" + styles = { + Comment: 'italic #0B6A94', # was: #0066ff', + Comment.Preproc: 'noitalic #B11414', + Comment.Special: 'italic #505050', + + Keyword: 'bold #D15E27', + Keyword.Type: '#D15E27', + + Operator.Word: 'bold #B80000', + + Name.Builtin: '#333333', + Name.Function: '#333333', + Name.Class: 'bold #333333', + Name.Namespace: 'bold #333333', + Name.Entity: 'bold #363636', + Name.Attribute: '#686868', + Name.Tag: 'bold #686868', + Name.Decorator: '#686868', + + String: '#AA891C', + Number: '#444444', + + Generic.Heading: 'bold #000080', + Generic.Subheading: 'bold #800080', + Generic.Deleted: '#aa0000', + Generic.Inserted: '#00aa00', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: '#F00 bg:#FAA' + } + +def setup(app): + pass + # uncomment for inline toc. links are broken unfortunately + ##app.connect('doctree-resolved', inject_toc) |
