big updates to a package
This commit is contained in:
parent
7c6c85cdfd
commit
2005b46c77
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
.venv/
|
.venv/
|
||||||
|
*.egg-info/
|
||||||
|
build/
|
||||||
|
0
config.toml
Normal file
0
config.toml
Normal file
15
default.nix
Normal file
15
default.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
with (import <nixpkgs> {});
|
||||||
|
|
||||||
|
mkShell {
|
||||||
|
buildInputs = with pkgs.python3Packages; [
|
||||||
|
python
|
||||||
|
venvShellHook
|
||||||
|
];
|
||||||
|
venvDir = "./.venv";
|
||||||
|
postVenvCreation = ''
|
||||||
|
unset SOURCE_DATE_EPOCH
|
||||||
|
'';
|
||||||
|
postShellHook = ''
|
||||||
|
unset SOURCE_DATE_EPOCH
|
||||||
|
'';
|
||||||
|
}
|
24
pyproject.toml
Normal file
24
pyproject.toml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=61.0"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
[project]
|
||||||
|
name = "z-py"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = [
|
||||||
|
{name = "Tyler Starr", email= "starrtyler88@gmail.com"}
|
||||||
|
]
|
||||||
|
description = "Personal note taking framework."
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.10"
|
||||||
|
classifiers = [
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: GNU General Public License (GPL)",
|
||||||
|
"Operating System :: OS Independent"
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
[project.urls]
|
||||||
|
"Homepage" = "https://github.com/starr-dusT/z-py"
|
||||||
|
"Repository" = "https://github.com/starr-dusT/z-py"
|
||||||
|
[project.scripts]
|
||||||
|
z = "z.z:main"
|
2
src/z/__init__.py
Normal file
2
src/z/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
from .z import *
|
||||||
|
from .create import *
|
5
src/z/__main__.py
Normal file
5
src/z/__main__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from z.z import main
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
@ -1,5 +1,5 @@
|
|||||||
from argparse import ArgumentTypeError
|
from argparse import ArgumentTypeError
|
||||||
from template import apply_template
|
from z.template import apply_template
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
import datetime
|
import datetime
|
@ -1,4 +1,4 @@
|
|||||||
import template_funcs as tf
|
from z import template_funcs
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
import re
|
import re
|
||||||
@ -14,4 +14,4 @@ def split_template(s: str) -> (List[str], str):
|
|||||||
|
|
||||||
def apply_template(path: Path, name: str):
|
def apply_template(path: Path, name: str):
|
||||||
fns, s = split_template(read_file(path, name))
|
fns, s = split_template(read_file(path, name))
|
||||||
return s.format(*[eval("tf." + fn)() for fn in fns])
|
return s.format(*[eval("template_funcs." + fn)() for fn in fns])
|
@ -1,10 +1,8 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
import create
|
from z import create
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
folder = "dude2"
|
|
||||||
|
|
||||||
def init_parser():
|
def init_parser():
|
||||||
parser = argparse.ArgumentParser(prog="z.py", description="top level prog")
|
parser = argparse.ArgumentParser(prog="z.py", description="top level prog")
|
||||||
sub_parsers = parser.add_subparsers(help="subcommand help")
|
sub_parsers = parser.add_subparsers(help="subcommand help")
|
||||||
@ -19,7 +17,6 @@ def main():
|
|||||||
z_file = Path("./.z")
|
z_file = Path("./.z")
|
||||||
if not z_file.is_file():
|
if not z_file.is_file():
|
||||||
raise Exception("You aren't in a z.py folder. Re-run in a z.py folder")
|
raise Exception("You aren't in a z.py folder. Re-run in a z.py folder")
|
||||||
|
|
||||||
parser = init_parser()
|
parser = init_parser()
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
args.func(args)
|
args.func(args)
|
Loading…
Reference in New Issue
Block a user