Skip to content

Commit 5cf010f

Browse files
committed
feat: using textual
1 parent 93c1472 commit 5cf010f

File tree

8 files changed

+893
-71
lines changed

8 files changed

+893
-71
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ $(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)
1821

1922
lint: $(VENV_DIR)
2023
@$(VENV_ACTIVATE) && flake8 --config=.flake8 $(SOURCE_DIR)

python/pyproject.toml

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

1722
[project.optional-dependencies]
1823
dev = [
1924
"black",
2025
"flake8",
21-
"requests"
26+
"textual-dev"
2227
]
2328

2429
[project.urls]
@@ -28,3 +33,6 @@ dev = [
2833
[build-system]
2934
requires = ["hatchling"]
3035
build-backend = "hatchling.build"
36+
37+
[tool.hatch.build.targets.wheel]
38+
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)