tedit 0.9.0__py3-none-any.whl
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.
- tedit/__init__.py +2 -0
- tedit/__main__.py +10 -0
- tedit/_pip_only.py +16 -0
- tedit/app.py +1698 -0
- tedit-0.9.0.dist-info/METADATA +20 -0
- tedit-0.9.0.dist-info/RECORD +12 -0
- tedit-0.9.0.dist-info/WHEEL +5 -0
- tedit-0.9.0.dist-info/entry_points.txt +3 -0
- tedit-0.9.0.dist-info/licenses/LICENSE.txt +60 -0
- tedit-0.9.0.dist-info/licenses/licenses/LICENSE_BSD.txt +9 -0
- tedit-0.9.0.dist-info/licenses/licenses/LICENSE_PSF.txt +42 -0
- tedit-0.9.0.dist-info/top_level.txt +1 -0
tedit/__init__.py
ADDED
tedit/__main__.py
ADDED
tedit/_pip_only.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import os, sys, pathlib
|
|
2
|
+
from importlib import metadata
|
|
3
|
+
|
|
4
|
+
def enforce_pip_only(package_name: str = "tedit") -> None:
|
|
5
|
+
here = pathlib.Path(__file__).resolve()
|
|
6
|
+
try:
|
|
7
|
+
dist = metadata.distribution(package_name)
|
|
8
|
+
dist_root = pathlib.Path(dist.locate_file(""))
|
|
9
|
+
if not str(here).startswith(str(dist_root)):
|
|
10
|
+
raise FileNotFoundError
|
|
11
|
+
except Exception:
|
|
12
|
+
sys.stderr.write(
|
|
13
|
+
"License notice: TE may be used only when installed via pip from the official PyPI package.\n"
|
|
14
|
+
f"Please run: pip install {package_name}\n"
|
|
15
|
+
)
|
|
16
|
+
sys.exit(1)
|