Skip to content

Commit

Permalink
Readd filepath dependency for resource resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
erykjj committed Apr 25, 2024
1 parent b27ebf9 commit bdec176
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/linkture/linkture.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
"""

__app__ = 'linkture'
__version__ = 'v2.6.1'
__version__ = 'v2.6.2'


import json, regex, sqlite3
import pandas as pd
from pathlib import Path
from unidecode import unidecode


Expand Down Expand Up @@ -66,9 +67,10 @@ def __init__(self, language='English', translate=None, form=None, separator=' ',
else:
form = 3
self._src_book_names = {}
path = Path(__file__).resolve().parent

self._tr_book_names = ['Bible']
con = sqlite3.connect('src/linkture/res/resources.db')
con = sqlite3.connect(path / 'res/resources.db')
cur = con.cursor()
for rec in cur.execute(f"SELECT * FROM Books WHERE Language = '{translate}';").fetchall():
if self._upper:
Expand All @@ -83,7 +85,7 @@ def __init__(self, language='English', translate=None, form=None, separator=' ',
item = unidecode(item)
normalized = regex.sub(r'\p{P}|\p{Z}', '', item.upper())
self._src_book_names[normalized] = rec[2]
with open('src/linkture/res/custom.json', 'r', encoding='UTF-8') as json_file:
with open(path / 'res/custom.json', 'r', encoding='UTF-8') as json_file:
b = json.load(json_file)
if language in b.keys():
for row in b[language]:
Expand Down

0 comments on commit bdec176

Please sign in to comment.