Skip to content

Commit 69f30a2

Browse files
committed
feat: using textual
1 parent 93c1472 commit 69f30a2

File tree

8 files changed

+1208
-77
lines changed

8 files changed

+1208
-77
lines changed

python/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

python/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ $(VENV_DIR):
88
python -m venv $@
99

1010
install: $(VENV_DIR)
11-
@$(VENV_ACTIVATE) && pip -v install .
11+
@$(VENV_ACTIVATE) && pip -v install '.[dev]'
1212

1313
clean-venv:
1414
@rm -rf $(VENV_DIR)
1515

1616
run:
17-
@(cd $(SOURCE_DIR); python -m bibleit $(ARGS))
17+
@$(VENV_ACTIVATE) && (cd $(SOURCE_DIR); python -m bibleit)
18+
19+
run-dev:
20+
@$(VENV_ACTIVATE) && (cd $(SOURCE_DIR); textual run --dev bibleit.app:Bibleit)
21+
22+
serve:
23+
@$(VENV_ACTIVATE) && (cd $(SOURCE_DIR); textual serve --dev "python -m bibleit")
1824

1925
lint: $(VENV_DIR)
2026
@$(VENV_ACTIVATE) && flake8 --config=.flake8 $(SOURCE_DIR)

python/pyproject.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ classifiers = [
1313
"License :: OSI Approved :: MIT License",
1414
"Operating System :: OS Independent",
1515
]
16+
dependencies = [
17+
"requests",
18+
"textual",
19+
"textual-autocomplete",
20+
"unidecode"
21+
]
1622

1723
[project.optional-dependencies]
1824
dev = [
1925
"black",
2026
"flake8",
21-
"requests"
27+
"textual-dev"
2228
]
2329

2430
[project.urls]
@@ -28,3 +34,6 @@ dev = [
2834
[build-system]
2935
requires = ["hatchling"]
3036
build-backend = "hatchling.build"
37+
38+
[tool.hatch.build.targets.wheel]
39+
packages = ["src/bibleit"]

python/repl.gif

-190 KB
Binary file not shown.

python/src/bibleit/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from bibleit.app import Bibleit
2+
3+
Bibleit().run()

python/src/bibleit/_ffi.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
POINTER,
1212
Structure,
1313
)
14-
from pathlib import Path
1514

1615

1716
def _lib_name() -> str:
@@ -85,6 +84,21 @@ class BidxIter(Structure):
8584
libbibleit.bidx_create.argtypes = [c_char_p, c_char_p]
8685
libbibleit.bidx_create.restype = c_int
8786

87+
libbibleit.bidx_iter_init.argtypes = [
88+
POINTER(BidxIter),
89+
POINTER(BidxFile),
90+
BidxRef,
91+
BidxRef,
92+
]
93+
libbibleit.bidx_iter_init.restype = c_int
94+
95+
libbibleit.bidx_iter_init_book.argtypes = [
96+
POINTER(BidxIter),
97+
POINTER(BidxFile),
98+
c_uint8,
99+
]
100+
libbibleit.bidx_iter_init_book.restype = c_int
101+
88102

89103
class BtFile(Structure):
90104
pass

0 commit comments

Comments
 (0)