mirror of
https://github.com/daylinmorgan/swydd.git
synced 2024-11-23 07:20:43 -06:00
docs: update automagic
This commit is contained in:
parent
3bf6c4e722
commit
d8a2dc6884
1 changed files with 5 additions and 4 deletions
|
@ -13,12 +13,13 @@
|
||||||
## Automagic Snippet
|
## Automagic Snippet
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# https://github.com/daylinmorgan/swydd?tab=readme-ov-file#automagic-snippet
|
if not (
|
||||||
_src = (_i := __import__)("pathlib").Path(__file__).parent / "swydd/__init__.py"
|
(_i := __import__)("importlib.util").util.find_spec("swydd")
|
||||||
if not (_i("importlib.util").util.find_spec("sywdd") or _src.is_file()):
|
or (_src := _i("pathlib").Path(__file__).parent / "swydd/__init__.py").is_file()
|
||||||
|
): # noqa | https://github.com/daylinmorgan/swydd?tab=readme-ov-file#automagic-snippet
|
||||||
_r = _i("urllib.request").request.urlopen("https://swydd.dayl.in/swydd.py")
|
_r = _i("urllib.request").request.urlopen("https://swydd.dayl.in/swydd.py")
|
||||||
_src.parent.mkdir(exist_ok=True)
|
_src.parent.mkdir(exist_ok=True)
|
||||||
_src.write_text(_r.read().decode("utf-8"))
|
_src.write_text(_r.read().decode())
|
||||||
```
|
```
|
||||||
|
|
||||||
## Alternatives
|
## Alternatives
|
||||||
|
|
Loading…
Reference in a new issue