Compare commits

...

3 Commits

Author SHA1 Message Date
173573b790 fix bug with no dir 2024-02-28 17:18:02 +03:00
b3fa52c8cb Stable cli interface after installing 2024-02-28 17:10:58 +03:00
8f8dd74c14 Better structure 2024-02-28 16:56:44 +03:00
4 changed files with 31 additions and 7 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
.idea/
venv/
result/
build/
*.egg-info
__pycache__

19
pyproject.toml Normal file
View File

@ -0,0 +1,19 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "tvms"
version = "1.0.0"
authors = [{name="Ilya Bezrukov", email="bezrukoff888@gmail.com" }]
description = "Script collection for TVMS"
readme = "README.md"
dependencies = ["python-docx", "click"]
requires-python = ">=3.10"
[project.scripts]
tvms = "tvms:cli"
[project.urls]
"Homepage" = "https://git.ilbz.ru/brinza/tvms"
"Bug Tracker" = "https://git.ilbz.ru/brinza/tvms/issues"

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
import random
import os
@ -31,6 +29,9 @@ def cli():
default="./result/table.py")
@click.option("--count", type=int, default=200)
def random_table(rtype, seed, prec, min, max, cols, docx, py, count):
os.makedirs(os.path.split(docx)[0], exist_ok=True)
os.makedirs(os.path.split(py)[0], exist_ok=True)
random.seed(seed)
rows = count // cols
@ -54,7 +55,3 @@ def random_table(rtype, seed, prec, min, max, cols, docx, py, count):
n += 1
document.save(docx)
if __name__ == '__main__':
cli()

6
tvms/__main__.py Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python3
from tvms import cli
if __name__ == '__main__':
cli()