token-utils 0.3.5__tar.gz → 0.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- token_utils-0.3.6/.flake8 +14 -0
- token_utils-0.3.6/.idea/.gitignore +5 -0
- token_utils-0.3.6/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- token_utils-0.3.6/.idea/modules.xml +8 -0
- token_utils-0.3.6/.idea/token-utils.iml +11 -0
- token_utils-0.3.6/.idea/vcs.xml +6 -0
- token_utils-0.3.6/.idea/workspace.xml +67 -0
- token_utils-0.3.6/.vscode/settings.json +4 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/PKG-INFO +1 -1
- token_utils-0.3.6/ae.bat +45 -0
- token_utils-0.3.6/docs/Makefile +20 -0
- token_utils-0.3.6/docs/doctrees/about_tokens.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/custom_warnings.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/environment.pickle +0 -0
- token_utils-0.3.6/docs/doctrees/index.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/tips.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/todo.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/token_class.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/tokenizing_methods.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/tutorial_prelude.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/untokenizing.doctree +0 -0
- token_utils-0.3.6/docs/doctrees/utils.doctree +0 -0
- token_utils-0.3.6/docs/html/.buildinfo +4 -0
- token_utils-0.3.6/docs/html/.buildinfo.bak +4 -0
- token_utils-0.3.6/docs/html/.nojekyll +0 -0
- token_utils-0.3.6/docs/html/_modules/index.html +119 -0
- token_utils-0.3.6/docs/html/_modules/token_utils/custom_warnings.html +154 -0
- token_utils-0.3.6/docs/html/_modules/token_utils/token_class.html +610 -0
- token_utils-0.3.6/docs/html/_modules/token_utils/tokenizing.html +543 -0
- token_utils-0.3.6/docs/html/_modules/token_utils/utils.html +467 -0
- token_utils-0.3.6/docs/html/_sources/about_tokens.rst.txt +414 -0
- token_utils-0.3.6/docs/html/_sources/custom_warnings.rst.txt +21 -0
- token_utils-0.3.6/docs/html/_sources/index.rst.txt +83 -0
- token_utils-0.3.6/docs/html/_sources/tips.rst.txt +445 -0
- token_utils-0.3.6/docs/html/_sources/todo.rst.txt +4 -0
- token_utils-0.3.6/docs/html/_sources/token_class.rst.txt +21 -0
- token_utils-0.3.6/docs/html/_sources/tokenizing_methods.rst.txt +20 -0
- token_utils-0.3.6/docs/html/_sources/tutorial_prelude.rst.txt +151 -0
- token_utils-0.3.6/docs/html/_sources/untokenizing.rst.txt +232 -0
- token_utils-0.3.6/docs/html/_sources/utils.rst.txt +21 -0
- token_utils-0.3.6/docs/html/_static/_sphinx_javascript_frameworks_compat.js +123 -0
- token_utils-0.3.6/docs/html/_static/basic.css +914 -0
- token_utils-0.3.6/docs/html/_static/css/badge_only.css +1 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/fontawesome-webfont.svg +2671 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-bold.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-bold.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-normal.woff +0 -0
- token_utils-0.3.6/docs/html/_static/css/fonts/lato-normal.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/css/theme.css +4 -0
- token_utils-0.3.6/docs/html/_static/custom.css +57 -0
- token_utils-0.3.6/docs/html/_static/doctools.js +149 -0
- token_utils-0.3.6/docs/html/_static/documentation_options.js +13 -0
- token_utils-0.3.6/docs/html/_static/file.png +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bold.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bold.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-italic.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-italic.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-regular.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-regular.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- token_utils-0.3.6/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- token_utils-0.3.6/docs/html/_static/jquery.js +2 -0
- token_utils-0.3.6/docs/html/_static/js/badge_only.js +1 -0
- token_utils-0.3.6/docs/html/_static/js/theme.js +1 -0
- token_utils-0.3.6/docs/html/_static/js/versions.js +228 -0
- token_utils-0.3.6/docs/html/_static/language_data.js +192 -0
- token_utils-0.3.6/docs/html/_static/minus.png +0 -0
- token_utils-0.3.6/docs/html/_static/plus.png +0 -0
- token_utils-0.3.6/docs/html/_static/pygments.css +75 -0
- token_utils-0.3.6/docs/html/_static/searchtools.js +632 -0
- token_utils-0.3.6/docs/html/_static/sphinx-new-tab-link.css +14 -0
- token_utils-0.3.6/docs/html/_static/sphinx_highlight.js +154 -0
- token_utils-0.3.6/docs/html/about_tokens.html +524 -0
- token_utils-0.3.6/docs/html/custom_warnings.html +194 -0
- token_utils-0.3.6/docs/html/genindex.html +417 -0
- token_utils-0.3.6/docs/html/index.html +348 -0
- token_utils-0.3.6/docs/html/objects.inv +0 -0
- token_utils-0.3.6/docs/html/py-modindex.html +155 -0
- token_utils-0.3.6/docs/html/search.html +135 -0
- token_utils-0.3.6/docs/html/searchindex.js +1 -0
- token_utils-0.3.6/docs/html/tips.html +736 -0
- token_utils-0.3.6/docs/html/todo.html +124 -0
- token_utils-0.3.6/docs/html/token_class.html +500 -0
- token_utils-0.3.6/docs/html/tokenizing_methods.html +290 -0
- token_utils-0.3.6/docs/html/tutorial_prelude.html +271 -0
- token_utils-0.3.6/docs/html/untokenizing.html +392 -0
- token_utils-0.3.6/docs/html/utils.html +316 -0
- token_utils-0.3.6/docs/make.bat +36 -0
- token_utils-0.3.6/docs/source/_static/custom.css +57 -0
- token_utils-0.3.6/docs/source/about_tokens.rst +414 -0
- token_utils-0.3.6/docs/source/conf.py +176 -0
- token_utils-0.3.6/docs/source/custom_warnings.rst +21 -0
- token_utils-0.3.6/docs/source/index.rst +83 -0
- token_utils-0.3.6/docs/source/tips.rst +445 -0
- token_utils-0.3.6/docs/source/todo.rst +4 -0
- token_utils-0.3.6/docs/source/token_class.rst +21 -0
- token_utils-0.3.6/docs/source/tokenizing_methods.rst +20 -0
- token_utils-0.3.6/docs/source/tutorial_prelude.rst +151 -0
- token_utils-0.3.6/docs/source/untokenizing.rst +232 -0
- token_utils-0.3.6/docs/source/utils.rst +21 -0
- token_utils-0.3.6/docs_examples/add_decorator.py +18 -0
- token_utils-0.3.6/docs_examples/decimal_py.py +19 -0
- token_utils-0.3.6/docs_examples/decimal_tok.py +11 -0
- token_utils-0.3.6/docs_examples/decimal_tok2.py +14 -0
- token_utils-0.3.6/docs_examples/decorator_example.txt +23 -0
- token_utils-0.3.6/docs_examples/factorial_1.py +22 -0
- token_utils-0.3.6/docs_examples/factorial_2.py +40 -0
- token_utils-0.3.6/docs_examples/inside_blocks.py +21 -0
- token_utils-0.3.6/docs_examples/nobreak.py +22 -0
- token_utils-0.3.6/docs_examples/nobreak.txt +31 -0
- token_utils-0.3.6/docs_examples/view_stack.py +16 -0
- token_utils-0.3.6/pypi_upload.bat +13 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/pyproject.toml +0 -6
- token_utils-0.3.6/run_all_tests.bat +25 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/__about__.py +1 -1
- token_utils-0.3.6/src/token_utils/py.typed +0 -0
- token_utils-0.3.6/tests/__init__.py +1 -0
- token_utils-0.3.6/tests/test_roundtrip.py +167 -0
- token_utils-0.3.6/tests/test_token_methods.py +270 -0
- token_utils-0.3.6/tests/test_utils.py +111 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/.gitignore +0 -0
- /token_utils-0.3.5/src/token_utils/py.typed → /token_utils-0.3.6/.nojekyll +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/LICENSE +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/README.md +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/__about__.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/__init__.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/__init__.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/_py_tokenize.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/_py_tokenize.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/_token_plus.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/_token_plus.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/custom_warnings.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/custom_warnings.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/token_class.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/token_class.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/tokenizing.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/tokenizing.pyi +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/utils.py +0 -0
- {token_utils-0.3.5 → token_utils-0.3.6}/src/token_utils/utils.pyi +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[flake8]
|
|
2
|
+
max-line-length = 88
|
|
3
|
+
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
|
|
4
|
+
ignore = E203, E266, E402, E501, W503
|
|
5
|
+
exclude =
|
|
6
|
+
# No need to traverse our git directory
|
|
7
|
+
.git/*,
|
|
8
|
+
# There's no value in checking cache directories
|
|
9
|
+
__pycache__,
|
|
10
|
+
# documentation, to be ignored
|
|
11
|
+
docs/*,
|
|
12
|
+
images/*,
|
|
13
|
+
# This contains our tests directory
|
|
14
|
+
tests/*,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/token-utils.iml" filepath="$PROJECT_DIR$/.idea/token-utils.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module external.system.id="pyproject.toml" type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/venv-token3.10" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="jdk" jdkName="~\github\token-utils\venv-token3.10" jdkType="Python SDK" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ChangeListManager">
|
|
7
|
+
<list default="true" id="3545b7d4-d817-410c-bc69-d7ce96a4dbcc" name="Changes" comment="" />
|
|
8
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
9
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
11
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="FileTemplateManagerImpl">
|
|
14
|
+
<option name="RECENT_TEMPLATES">
|
|
15
|
+
<list>
|
|
16
|
+
<option value="Python Script" />
|
|
17
|
+
</list>
|
|
18
|
+
</option>
|
|
19
|
+
</component>
|
|
20
|
+
<component name="Git.Settings">
|
|
21
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
22
|
+
</component>
|
|
23
|
+
<component name="ProjectColorInfo">{
|
|
24
|
+
"associatedIndex": 4,
|
|
25
|
+
"fromUser": false
|
|
26
|
+
}</component>
|
|
27
|
+
<component name="ProjectId" id="3JjJsQEtY2V4TIefkRlMyE5hIqZ" />
|
|
28
|
+
<component name="ProjectViewState">
|
|
29
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
30
|
+
<option name="showLibraryContents" value="true" />
|
|
31
|
+
</component>
|
|
32
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
33
|
+
"keyToString": {
|
|
34
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
35
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
36
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
37
|
+
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
|
38
|
+
"codeWithMe.voiceChat.enabledByDefault": "false",
|
|
39
|
+
"git-widget-placeholder": "master",
|
|
40
|
+
"ignore.virus.scanning.warn.message": "true",
|
|
41
|
+
"last_opened_file_path": "C:/Users/Andre/github/token-utils",
|
|
42
|
+
"nodejs_package_manager_path": "npm",
|
|
43
|
+
"python.packages.toolwindow.project.migrated.to.right.top.v2": "true",
|
|
44
|
+
"settings.editor.selected.configurable": "preferences.pluginManager"
|
|
45
|
+
}
|
|
46
|
+
}]]></component>
|
|
47
|
+
<component name="SharedIndexes">
|
|
48
|
+
<attachedChunks>
|
|
49
|
+
<set>
|
|
50
|
+
<option value="bundled-python-sdk-73a66231627c-5bd6d13a2a75-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-262.10968.92" />
|
|
51
|
+
</set>
|
|
52
|
+
</attachedChunks>
|
|
53
|
+
</component>
|
|
54
|
+
<component name="TaskManager">
|
|
55
|
+
<task active="true" id="Default" summary="Default task">
|
|
56
|
+
<changelist id="3545b7d4-d817-410c-bc69-d7ce96a4dbcc" name="Changes" comment="" />
|
|
57
|
+
<created>1790168749536</created>
|
|
58
|
+
<option name="number" value="Default" />
|
|
59
|
+
<option name="presentableId" value="Default" />
|
|
60
|
+
<updated>1790168749536</updated>
|
|
61
|
+
</task>
|
|
62
|
+
<servers />
|
|
63
|
+
</component>
|
|
64
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
65
|
+
<option name="version" value="3" />
|
|
66
|
+
</component>
|
|
67
|
+
</project>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: token-utils
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: Convenient tools to deal with tokens.
|
|
5
5
|
Project-URL: Documentation, https://aroberge.github.io/token-utils/docs/html/
|
|
6
6
|
Project-URL: Issues, https://github.com/aroberge/token-utils/issues
|
token_utils-0.3.6/ae.bat
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
echo off
|
|
2
|
+
REM Default is Python 3.10
|
|
3
|
+
|
|
4
|
+
if "%1"=="3.8" goto py_38
|
|
5
|
+
if "%1"=="3.9" goto py_39
|
|
6
|
+
if "%1"=="3.10" goto py_310
|
|
7
|
+
if "%1"=="3.11" goto py_311
|
|
8
|
+
if "%1"=="3.12" goto py_312
|
|
9
|
+
if "%1"=="3.13" goto py_313
|
|
10
|
+
if "%1"=="3.14" goto py_314
|
|
11
|
+
if "%1"=="3.15" goto py_315
|
|
12
|
+
|
|
13
|
+
:py_310
|
|
14
|
+
venv-token3.10\scripts\activate
|
|
15
|
+
goto end
|
|
16
|
+
|
|
17
|
+
:py_38
|
|
18
|
+
venv-token3.8\scripts\activate
|
|
19
|
+
goto end
|
|
20
|
+
|
|
21
|
+
:py_39
|
|
22
|
+
venv-token3.9\scripts\activate
|
|
23
|
+
goto end
|
|
24
|
+
|
|
25
|
+
:py_311
|
|
26
|
+
venv-token3.11\scripts\activate
|
|
27
|
+
goto end
|
|
28
|
+
|
|
29
|
+
:py_312
|
|
30
|
+
venv-token3.12\scripts\activate
|
|
31
|
+
goto end
|
|
32
|
+
|
|
33
|
+
:py_313
|
|
34
|
+
venv-token3.13\scripts\activate
|
|
35
|
+
goto end
|
|
36
|
+
|
|
37
|
+
:py_314
|
|
38
|
+
venv-token3.14\scripts\activate
|
|
39
|
+
goto end
|
|
40
|
+
|
|
41
|
+
:py_315
|
|
42
|
+
venv-token3.15\scripts\activate
|
|
43
|
+
goto end
|
|
44
|
+
|
|
45
|
+
:end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
SPHINXPROJ = token-utils
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html class="writer-html5" lang="en" data-content_root="../">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>Overview: module code — token-utils 0.3.4 documentation</title>
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="../_static/sphinx-new-tab-link.css?v=d87cb1ac" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=c7e4a82f" />
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script src="../_static/jquery.js?v=5d32c60e"></script>
|
|
16
|
+
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
17
|
+
<script src="../_static/documentation_options.js?v=1e28cc32"></script>
|
|
18
|
+
<script src="../_static/doctools.js?v=9bcbadda"></script>
|
|
19
|
+
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
20
|
+
<script src="../_static/js/theme.js"></script>
|
|
21
|
+
<link rel="index" title="Index" href="../genindex.html" />
|
|
22
|
+
<link rel="search" title="Search" href="../search.html" />
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body class="wy-body-for-nav">
|
|
26
|
+
<div class="wy-grid-for-nav">
|
|
27
|
+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
28
|
+
<div class="wy-side-scroll">
|
|
29
|
+
<div class="wy-side-nav-search" >
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<a href="../index.html" class="icon icon-home">
|
|
34
|
+
token-utils
|
|
35
|
+
</a>
|
|
36
|
+
<div role="search">
|
|
37
|
+
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
38
|
+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
39
|
+
<input type="hidden" name="check_keywords" value="yes" />
|
|
40
|
+
<input type="hidden" name="area" value="default" />
|
|
41
|
+
</form>
|
|
42
|
+
</div>
|
|
43
|
+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
44
|
+
<ul>
|
|
45
|
+
<li class="toctree-l1"><a class="reference internal" href="../about_tokens.html"> About tokens: Python vs token-utils</a></li>
|
|
46
|
+
<li class="toctree-l1"><a class="reference internal" href="../untokenizing.html"> About untokenizing</a></li>
|
|
47
|
+
<li class="toctree-l1"><a class="reference internal" href="../tutorial_prelude.html"> Prelude to the tutorial</a></li>
|
|
48
|
+
<li class="toctree-l1"><a class="reference internal" href="../tips.html"> Tutorial: recipes, tips, and tricks</a></li>
|
|
49
|
+
</ul>
|
|
50
|
+
<p class="caption" role="heading"><span class="caption-text">API</span></p>
|
|
51
|
+
<ul>
|
|
52
|
+
<li class="toctree-l1"><a class="reference internal" href="../token_class.html">Token class</a></li>
|
|
53
|
+
<li class="toctree-l1"><a class="reference internal" href="../tokenizing_methods.html">Tokenizing related methods</a></li>
|
|
54
|
+
<li class="toctree-l1"><a class="reference internal" href="../utils.html">Utility functions and classes</a></li>
|
|
55
|
+
<li class="toctree-l1"><a class="reference internal" href="../custom_warnings.html">Custom warnings</a></li>
|
|
56
|
+
</ul>
|
|
57
|
+
<p class="caption" role="heading"><span class="caption-text">Appendix</span></p>
|
|
58
|
+
<ul>
|
|
59
|
+
<li class="toctree-l1"><a class="reference internal" href="../todo.html">To do</a></li>
|
|
60
|
+
</ul>
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</nav>
|
|
65
|
+
|
|
66
|
+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
67
|
+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
68
|
+
<a href="../index.html">token-utils</a>
|
|
69
|
+
</nav>
|
|
70
|
+
|
|
71
|
+
<div class="wy-nav-content">
|
|
72
|
+
<div class="rst-content style-external-links">
|
|
73
|
+
<div role="navigation" aria-label="Page navigation">
|
|
74
|
+
<ul class="wy-breadcrumbs">
|
|
75
|
+
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
76
|
+
<li class="breadcrumb-item active">Overview: module code</li>
|
|
77
|
+
<li class="wy-breadcrumbs-aside">
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
80
|
+
<hr/>
|
|
81
|
+
</div>
|
|
82
|
+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
83
|
+
<div itemprop="articleBody">
|
|
84
|
+
|
|
85
|
+
<h1>All modules for which code is available</h1>
|
|
86
|
+
<ul><li><a href="token_utils/custom_warnings.html">token_utils.custom_warnings</a></li>
|
|
87
|
+
<li><a href="token_utils/token_class.html">token_utils.token_class</a></li>
|
|
88
|
+
<li><a href="token_utils/tokenizing.html">token_utils.tokenizing</a></li>
|
|
89
|
+
<li><a href="token_utils/utils.html">token_utils.utils</a></li>
|
|
90
|
+
</ul>
|
|
91
|
+
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<footer>
|
|
95
|
+
|
|
96
|
+
<hr/>
|
|
97
|
+
|
|
98
|
+
<div role="contentinfo">
|
|
99
|
+
<p>© Copyright 2026, André Roberge.</p>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
103
|
+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
104
|
+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
</footer>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</section>
|
|
111
|
+
</div>
|
|
112
|
+
<script>
|
|
113
|
+
jQuery(function () {
|
|
114
|
+
SphinxRtdTheme.Navigation.enable(true);
|
|
115
|
+
});
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
</body>
|
|
119
|
+
</html>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html class="writer-html5" lang="en" data-content_root="../../">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>token_utils.custom_warnings — token-utils 0.3.2 documentation</title>
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="../../_static/sphinx-new-tab-link.css?v=d87cb1ac" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="../../_static/custom.css?v=c7e4a82f" />
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script src="../../_static/jquery.js?v=5d32c60e"></script>
|
|
16
|
+
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
17
|
+
<script src="../../_static/documentation_options.js?v=71d9d8e6"></script>
|
|
18
|
+
<script src="../../_static/doctools.js?v=9bcbadda"></script>
|
|
19
|
+
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
20
|
+
<script src="../../_static/js/theme.js"></script>
|
|
21
|
+
<link rel="index" title="Index" href="../../genindex.html" />
|
|
22
|
+
<link rel="search" title="Search" href="../../search.html" />
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body class="wy-body-for-nav">
|
|
26
|
+
<div class="wy-grid-for-nav">
|
|
27
|
+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
28
|
+
<div class="wy-side-scroll">
|
|
29
|
+
<div class="wy-side-nav-search" >
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<a href="../../index.html" class="icon icon-home">
|
|
34
|
+
token-utils
|
|
35
|
+
</a>
|
|
36
|
+
<div role="search">
|
|
37
|
+
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
38
|
+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
39
|
+
<input type="hidden" name="check_keywords" value="yes" />
|
|
40
|
+
<input type="hidden" name="area" value="default" />
|
|
41
|
+
</form>
|
|
42
|
+
</div>
|
|
43
|
+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
44
|
+
<ul>
|
|
45
|
+
<li class="toctree-l1"><a class="reference internal" href="../../about_tokens.html"> About tokens: Python vs token-utils</a></li>
|
|
46
|
+
<li class="toctree-l1"><a class="reference internal" href="../../untokenizing.html"> About untokenizing</a></li>
|
|
47
|
+
<li class="toctree-l1"><a class="reference internal" href="../../tips.html"> Recipes, tips, and tricks</a></li>
|
|
48
|
+
</ul>
|
|
49
|
+
<p class="caption" role="heading"><span class="caption-text">API</span></p>
|
|
50
|
+
<ul>
|
|
51
|
+
<li class="toctree-l1"><a class="reference internal" href="../../token_class.html">Token class</a></li>
|
|
52
|
+
<li class="toctree-l1"><a class="reference internal" href="../../tokenizing_methods.html">Tokenizing related methods</a></li>
|
|
53
|
+
</ul>
|
|
54
|
+
<p class="caption" role="heading"><span class="caption-text">Appendix</span></p>
|
|
55
|
+
<ul>
|
|
56
|
+
<li class="toctree-l1"><a class="reference internal" href="../../todo.html">To do</a></li>
|
|
57
|
+
</ul>
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</nav>
|
|
62
|
+
|
|
63
|
+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
64
|
+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
65
|
+
<a href="../../index.html">token-utils</a>
|
|
66
|
+
</nav>
|
|
67
|
+
|
|
68
|
+
<div class="wy-nav-content">
|
|
69
|
+
<div class="rst-content style-external-links">
|
|
70
|
+
<div role="navigation" aria-label="Page navigation">
|
|
71
|
+
<ul class="wy-breadcrumbs">
|
|
72
|
+
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
73
|
+
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
|
|
74
|
+
<li class="breadcrumb-item active">token_utils.custom_warnings</li>
|
|
75
|
+
<li class="wy-breadcrumbs-aside">
|
|
76
|
+
</li>
|
|
77
|
+
</ul>
|
|
78
|
+
<hr/>
|
|
79
|
+
</div>
|
|
80
|
+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
81
|
+
<div itemprop="articleBody">
|
|
82
|
+
|
|
83
|
+
<h1>Source code for token_utils.custom_warnings</h1><div class="highlight"><pre>
|
|
84
|
+
<span></span><span class="kn">import</span><span class="w"> </span><span class="nn">sys</span>
|
|
85
|
+
<span class="kn">import</span><span class="w"> </span><span class="nn">warnings</span>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
<span class="k">class</span><span class="w"> </span><span class="nc">TokenUtilsEOFWarning</span><span class="p">(</span><span class="ne">UserWarning</span><span class="p">):</span>
|
|
89
|
+
<span class="w"> </span><span class="sd">"""Raised when and EOF condition is reached."""</span>
|
|
90
|
+
|
|
91
|
+
<span class="k">pass</span>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
<div class="viewcode-block" id="SemiColonWarning">
|
|
95
|
+
<a class="viewcode-back" href="../../tokenizing_methods.html#token_utils.tokenizing.SemiColonWarning">[docs]</a>
|
|
96
|
+
<span class="k">class</span><span class="w"> </span><span class="nc">SemiColonWarning</span><span class="p">(</span><span class="ne">UserWarning</span><span class="p">):</span>
|
|
97
|
+
<span class="w"> </span><span class="sd">"""Raised when a semi-colon is found separating statements</span>
|
|
98
|
+
<span class="sd"> on a logical line other than the first one.</span>
|
|
99
|
+
<span class="sd"> """</span>
|
|
100
|
+
|
|
101
|
+
<span class="c1"># We don't warn if it's on the first line in case it's a</span>
|
|
102
|
+
<span class="c1"># "one-liner" passed as an argument on a command line</span>
|
|
103
|
+
<span class="k">pass</span></div>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<span class="k">def</span><span class="w"> </span><span class="nf">disable_warnings</span><span class="p">():</span>
|
|
108
|
+
<span class="w"> </span><span class="sd">"""Disable all warnings arising from token_utils."""</span>
|
|
109
|
+
|
|
110
|
+
<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">"ignore"</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="n">TokenUtilsEOFWarning</span><span class="p">)</span>
|
|
111
|
+
<span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">"ignore"</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="n">SemiColonWarning</span><span class="p">)</span>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<span class="k">def</span><span class="w"> </span><span class="nf">custom_showwarning</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">category</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">lineno</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">line</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
|
115
|
+
<span class="w"> </span><span class="sd">"""Simply show the category and message, as the rest of the potential output</span>
|
|
116
|
+
<span class="sd"> would not be useful.</span>
|
|
117
|
+
<span class="sd"> """</span>
|
|
118
|
+
<span class="n">output_file</span> <span class="o">=</span> <span class="n">file</span> <span class="k">if</span> <span class="n">file</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">sys</span><span class="o">.</span><span class="n">stderr</span>
|
|
119
|
+
<span class="c1"># Format your warning message cleanly without extra newlines</span>
|
|
120
|
+
<span class="n">msg</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="se">\n</span><span class="s2"> </span><span class="si">{</span><span class="n">category</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">message</span><span class="si">}</span><span class="se">\n</span><span class="s2">"</span>
|
|
121
|
+
<span class="n">output_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<span class="n">warnings</span><span class="o">.</span><span class="n">showwarning</span> <span class="o">=</span> <span class="n">custom_showwarning</span>
|
|
125
|
+
</pre></div>
|
|
126
|
+
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<footer>
|
|
130
|
+
|
|
131
|
+
<hr/>
|
|
132
|
+
|
|
133
|
+
<div role="contentinfo">
|
|
134
|
+
<p>© Copyright 2026, André Roberge.</p>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
138
|
+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
139
|
+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
</footer>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</section>
|
|
146
|
+
</div>
|
|
147
|
+
<script>
|
|
148
|
+
jQuery(function () {
|
|
149
|
+
SphinxRtdTheme.Navigation.enable(true);
|
|
150
|
+
});
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
</body>
|
|
154
|
+
</html>
|