Skip to content

Commit

Permalink
v0.1.01
Browse files Browse the repository at this point in the history
  • Loading branch information
eliranwong committed Oct 12, 2024
1 parent 5099701 commit aabd947
Show file tree
Hide file tree
Showing 15 changed files with 317 additions and 622 deletions.
589 changes: 294 additions & 295 deletions setup.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions uniquebible/gui/MainWindow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os, signal, sys, re, base64, webbrowser, platform, subprocess, requests, update, logging, zipfile, glob
from uniquebible import config
import markdown, time
from distutils import util
#from distutils import util
from functools import partial
from pathlib import Path

Expand Down Expand Up @@ -1943,7 +1943,7 @@ def htmlWrapper(self, text, parsing=False, view="study", linebreak=True, html=Tr
("(</table>|</ol>|</ul>)<br>", r"\1"),
("<a [^\n<>]*?href=['{0}]([^\n<>]*?)['{0}][^\n<>]*?>".format('"'),
r"<a href='javascript:void(0)' onclick='website({0}\1{0})'>".format('"')),
("onclick='website\({0}([^\n<>]*?).uba{0}\)'".format('"'), r"onclick='uba({0}\1.uba{0})'".format('"'))
(r"onclick='website\({0}([^\n<>]*?).uba{0}\)'".format('"'), r"onclick='uba({0}\1.uba{0})'".format('"'))
)
if linebreak:
for search, replace in searchReplace1:
Expand Down Expand Up @@ -4431,7 +4431,7 @@ def refineCommand(self, command):
if command in self.crossPlatform.textList:
command = f"TEXT:::{command}"
# match a bible reference, started with book number, e.g. 43.3.16
elif re.search("^[0-9]+?\.[0-9]+?\.[0-9]+?$", command):
elif re.search(r"^[0-9]+?\.[0-9]+?\.[0-9]+?$", command):
b, c, v = [int(i) for i in command.split(".")]
command = self.textCommandParser.bcvToVerseReference(b, c, v)
else:
Expand Down Expand Up @@ -4802,10 +4802,10 @@ def switchLandscapeMode(self):
self.centralWidget.switchLandscapeMode()
self.resizeCentral()

def setLandscapeMode(self, mode):
"""def setLandscapeMode(self, mode):
config.landscapeMode = bool(util.strtobool(mode))
self.centralWidget.switchLandscapeMode()
self.resizeCentral()
self.resizeCentral()"""

def resizeCentral(self):
self.centralWidget.resizeMe()
Expand Down
10 changes: 10 additions & 0 deletions uniquebible/latest_changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
PIP package:

0.1.01

* tested startup with python 3.12

* added missing icons

Old versions:

Changes in 35.31:
* Add webSiteTitle to config
* Add scripts to start/stop http and api server
Expand Down
2 changes: 1 addition & 1 deletion uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def addHoverFeatureToBibleLinks(text):
text = re.sub(r'<(a|ref) onclick="bcv\(([0-9]+?),([0-9]+?),([0-9]+?),([0-9]+?),([0-9]+?)\)">', r'<\1 onclick="bcv(\2,\3,\4,\5,\6)" onmouseover="imv(\2,\3,\4,\5,\6)">', text)

# Fixed duplicated onmouseover
duplicatedPattern = re.compile('onmouseover="imv\([^\(\)]+?\)" onmouseover="imv')
duplicatedPattern = re.compile(r'onmouseover="imv\([^\(\)]+?\)" onmouseover="imv')
while duplicatedPattern.search(text):
text = re.sub(duplicatedPattern, 'onmouseover="imv', text)

Expand Down
4 changes: 2 additions & 2 deletions uniquebible/plugins/startup/fixHrefLinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
def fixHrefLinks(text):
if config.enableHttpServer:
searchRelace = (
("""onclick="website(\('.*?')\)""", r"""onclick="window.open\1, '_blank')"""),
("""onclick='website(\(".*?")\)""", r"""onclick='window.open\1, "_blank")"""),
(r"""onclick="website(\('.*?')\)""", r"""onclick="window.open\1, '_blank')"""),
(r"""onclick='website(\(".*?")\)""", r"""onclick='window.open\1, "_blank")"""),
)
for search, replace in searchRelace:
text = re.sub(search, replace, text)
Expand Down
8 changes: 4 additions & 4 deletions uniquebible/plugins/startup/highlightActiveVerse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def highlightActiveVerseMain(text):
# underline
#('(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.mainB, config.mainC, config.mainV), r"\1<u>\2</u></verse>"),
# color
("(<span id='s{0}\.{1}\.{2}'.*?>)(.*?)</span>".format(config.mainB, config.mainC, config.mainV), r"\1<span style='color: {0};'>{1}\2{2}</span></span>".format(colour, terminalTextStart, terminalTextEnd)),
('(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.mainB, config.mainC, config.mainV), r"\1<span style='color: {0};'>{1}\2{2}</span></verse>".format(colour, terminalTextStart, terminalTextEnd)),
(r"(<span id='s{0}\.{1}\.{2}'.*?>)(.*?)</span>".format(config.mainB, config.mainC, config.mainV), r"\1<span style='color: {0};'>{1}\2{2}</span></span>".format(colour, terminalTextStart, terminalTextEnd)),
(r'(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.mainB, config.mainC, config.mainV), r"\1<span style='color: {0};'>{1}\2{2}</span></verse>".format(colour, terminalTextStart, terminalTextEnd)),
(r"""(document\.title="_menu:::)([^<>]+?)(\.{0}\.{1}\.{2}"'>\2</ref>\)</sup></td><td><bibletext class='\2'>)(.*?)</bibletext>""".format(config.mainB, config.mainC, config.mainV), r"\1\2\3<span style='color: {0};'>{1}\4{2}</span></bibletext>".format(colour, terminalTextStart, terminalTextEnd)),
)
for search, replace in searchReplace:
Expand All @@ -24,8 +24,8 @@ def highlightActiveVerseStudy(text):
# underline
#('(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.studyB, config.studyC, config.studyV), r"\1<u>\2</u></verse>"),
# color
("(<span id='s{0}\.{1}\.{2}'.*?>)(.*?)</span>".format(config.studyB, config.studyC, config.studyV), r"\1<span style='color: {0};'>{1}\2{2}</span></span>".format(colour, terminalTextStart, terminalTextEnd)),
('(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.studyB, config.studyC, config.studyV), r"\1<span style='color: {0};'>{1}\2{2}</span></verse>".format(colour, terminalTextStart, terminalTextEnd)),
(r"(<span id='s{0}\.{1}\.{2}'.*?>)(.*?)</span>".format(config.studyB, config.studyC, config.studyV), r"\1<span style='color: {0};'>{1}\2{2}</span></span>".format(colour, terminalTextStart, terminalTextEnd)),
(r'(<vid id="v{0}\.{1}\.{2}".*?</vid>)(.*?)</verse>'.format(config.studyB, config.studyC, config.studyV), r"\1<span style='color: {0};'>{1}\2{2}</span></verse>".format(colour, terminalTextStart, terminalTextEnd)),
)
for search, replace in searchReplace:
text = re.sub(search, replace, text)
Expand Down
14 changes: 0 additions & 14 deletions uniquebible/tests/BibleBooks_test.py

This file was deleted.

134 changes: 0 additions & 134 deletions uniquebible/tests/BibleVerseParser_test.py

This file was deleted.

15 changes: 0 additions & 15 deletions uniquebible/tests/LanguageUtil_test.py

This file was deleted.

13 changes: 0 additions & 13 deletions uniquebible/tests/TestRunner.py

This file was deleted.

Loading

0 comments on commit aabd947

Please sign in to comment.