Skip to content

Commit

Permalink
fixed launching terminal mode on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
eliranwong committed Oct 19, 2024
1 parent db033d9 commit 21290da
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 119 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/
setup(
name=package,
version="0.1.05",
version="0.1.06",
python_requires=">=3.8, <3.13",
description=f"UniqueBible App is a cross-platform & offline bible application, integrated with high-quality resources and unique features. Developers: Eliran Wong and Oliver Tseng",
long_description=long_description,
Expand Down
116 changes: 0 additions & 116 deletions test.py

This file was deleted.

44 changes: 43 additions & 1 deletion uniquebible/db/BiblesSqlite_nogui.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,10 @@ class Bible:

CREATE_COMMENTARY_TABLE = "CREATE TABLE Commentary (Book INT, Chapter INT, Scripture TEXT)"

def __init__(self, text):
def __init__(self, text=None):
# connect [text].bible
if text is None:
text = config.mainText
self.text = text
self.connection = None
self.cursor = None
Expand All @@ -825,6 +827,46 @@ def __del__(self):
# #self.cursor.execute("COMMIT")
self.connection.close()

# Check if a verse is empty
def isNonEmptyVerse(self, b, c, v):
query = "SELECT Scripture FROM Verses WHERE Book=? AND Chapter=? AND Verse=?"
self.cursor.execute(query, (b, c, v))
scripture = self.cursor.fetchone()
if not scripture:
return False
return True if scripture[-1].strip() else False

# Expand a list of verse range to include individual verses
def getEverySingleVerseList(self, verseList) -> list:
allVerses = []
for verse in verseList:
if len(verse) == 3:
allVerses.append(verse)
elif len(verse) == 4:
b, c, vs, ve = verse
for v in self.getVerseList(b, c, vs, ve):
allVerses.append((b, c, v))
elif len(verse) == 5:
b, cs, vs, ce, ve = verse
if (cs > ce):
pass
elif (cs == ce):
for v in self.getVerseList(b, cs, vs, ve):
allVerses.append((b, cs, v))
else:
c = cs
for v in self.getVerseList(b, c, vs):
allVerses.append((b, c, v))
c += 1
while (c < ce):
for v in self.getVerseList(b, c):
allVerses.append((b, c, v))
c += 1
if (c == ce):
for v in self.getVerseList(b, c, 1, ve):
allVerses.append((b, c, v))
return allVerses

def bcvToVerseReference(self, b, c, v):
return BibleVerseParser(config.parserStandarisation).bcvToVerseReference(b, c, v)

Expand Down
2 changes: 2 additions & 0 deletions uniquebible/startup/nonGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# manage latest update
def checkApplicationUpdateCli():
# TODO disable for now; update later
return False
try:
print("Checking the latest version ...")
checkFile = "{0}UniqueBibleAppVersion.txt".format(UpdateUtil.repository)
Expand Down
3 changes: 2 additions & 1 deletion uniquebible/util/CatalogUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from uniquebible import config
from uniquebible.util.FileUtil import FileUtil
from uniquebible.util.GitHubRepoInfo import GitHubRepoInfo
from uniquebible.util.GithubUtil import GithubUtil
if not config.noQt:
from uniquebible.util.GithubUtil import GithubUtil


class CatalogUtil:
Expand Down

0 comments on commit 21290da

Please sign in to comment.