From 9c9272ba2a1a8fdef4049b160877576c31bc6cf2 Mon Sep 17 00:00:00 2001 From: eliranwong Date: Thu, 10 Oct 2024 18:57:37 +0000 Subject: [PATCH] pip verson 0.0.3; fixed launching --- .gitignore | 4 ++-- setup.py | 2 +- uniquebible/gui/DownloadBibleMp3Dialog.py | 3 ++- uniquebible/gui/Worker.py | 4 ++-- uniquebible/plugins/chatGPT/000_UBA.py | 2 +- uniquebible/plugins/chatGPT/execute python code.py | 5 +++-- uniquebible/plugins/chatGPT/integrate google searches.py | 3 ++- uniquebible/plugins/context/Charts and Table.py | 2 +- .../plugins/context/English Dictionaries_Ctrl+Shift+D.py | 2 +- uniquebible/plugins/context/Gmail.py | 2 +- uniquebible/plugins/context/Google.py | 2 +- .../plugins/context/Insert References into Note Editor.py | 2 +- .../context/Insert Text into Note Editor_Ctrl+Shift+J.py | 2 +- uniquebible/plugins/context/Interlinear Data.py | 2 +- uniquebible/plugins/context/Louw-Nida Lexicon Gloss.py | 2 +- uniquebible/plugins/context/Microsoft Outlook.py | 2 +- uniquebible/plugins/context/Presentation_Ctrl+Shift+Y.py | 2 +- uniquebible/plugins/context/Read All Verses.py | 3 ++- uniquebible/plugins/context/Run as Command_Ctrl+D.py | 2 +- .../plugins/context/Search Bible for English Word Forms.py | 2 +- uniquebible/plugins/context/Strong Number to CSV.py | 3 ++- uniquebible/plugins/context/YouTube Downloader.py | 2 +- uniquebible/plugins/context/YouTube.py | 2 +- uniquebible/plugins/menu/Bible Characters.py | 3 ++- uniquebible/plugins/menu/Bible Chat.py | 3 ++- uniquebible/plugins/menu/Bible Commentaries.py | 3 ++- uniquebible/plugins/menu/Bible Data.py | 3 ++- uniquebible/plugins/menu/Bible Dictionaries.py | 3 ++- uniquebible/plugins/menu/Bible Encyclopedia.py | 3 ++- uniquebible/plugins/menu/Bible Lexicons.py | 3 ++- uniquebible/plugins/menu/Bible Locations.py | 3 ++- uniquebible/plugins/menu/Bible Parallels.py | 3 ++- uniquebible/plugins/menu/Bible Promises.py | 3 ++- uniquebible/plugins/menu/Bible Timelines.py | 3 ++- uniquebible/plugins/menu/Bible Topics.py | 3 ++- uniquebible/plugins/menu/Bible.py | 3 ++- uniquebible/plugins/menu/ChatGPT.py | 2 +- uniquebible/plugins/menu/Display Word Frequency.py | 2 +- uniquebible/plugins/menu/Extract Text.py | 3 ++- uniquebible/plugins/menu/Gmail.py | 2 +- uniquebible/plugins/menu/Google Drive Backup.py | 3 ++- uniquebible/plugins/menu/Google Drive Restore.py | 3 ++- uniquebible/plugins/menu/Google.py | 2 +- uniquebible/plugins/menu/Interlinear Data.py | 2 +- uniquebible/plugins/menu/Journal and Bible Reading Plan.py | 2 +- uniquebible/plugins/menu/Microsoft Calendar.py | 2 +- uniquebible/plugins/menu/Microsoft Excel.py | 2 +- uniquebible/plugins/menu/Microsoft Forms.py | 2 +- uniquebible/plugins/menu/Microsoft Office 365.py | 2 +- uniquebible/plugins/menu/Microsoft OneDrive.py | 2 +- uniquebible/plugins/menu/Microsoft OneNote.py | 2 +- uniquebible/plugins/menu/Microsoft Outlook.py | 2 +- uniquebible/plugins/menu/Microsoft PowerPoint.py | 2 +- uniquebible/plugins/menu/Microsoft Teams.py | 2 +- uniquebible/plugins/menu/Microsoft Word.py | 2 +- uniquebible/plugins/menu/Presentation.py | 2 +- uniquebible/plugins/menu/Reference Books.py | 3 ++- uniquebible/plugins/menu/Terminal Mode.py | 3 ++- uniquebible/plugins/menu/Terminal.py | 3 ++- uniquebible/plugins/menu/Third Party Dictionaries.py | 3 ++- uniquebible/plugins/menu/ToDo.py | 3 ++- uniquebible/plugins/menu/ePub Viewer Full Screen.py | 3 ++- uniquebible/plugins/menu/ePub Viewer New Window.py | 3 ++- uniquebible/plugins/menu/ePub Viewer.py | 3 ++- uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py | 3 ++- .../plugins/startup/customise_terminal_mode_commands.py | 2 +- .../plugins/startup/customise_terminal_mode_key_bindings.py | 2 +- uniquebible/plugins/startup/fixDisplayColour.py | 2 +- uniquebible/plugins/startup/fixHrefLinks.py | 3 ++- uniquebible/plugins/startup/fixNonHtmlColour.py | 3 ++- uniquebible/plugins/startup/highlightActiveVerse.py | 3 ++- uniquebible/plugins/startup/keywordAlias.py | 2 +- uniquebible/plugins/startup/qrCodeCommand.py | 2 +- uniquebible/plugins/startup/screenCommand.py | 3 ++- uniquebible/plugins/startup/tagLexicalEntry.py | 3 ++- .../plugins/startup/transformSingleVerseLinkToRange.py | 3 ++- uniquebible/util/DatafileLocation.py | 3 ++- uniquebible/util/LocalCliHandler.py | 2 +- 78 files changed, 118 insertions(+), 81 deletions(-) diff --git a/.gitignore b/.gitignore index 76ccdc994a..758c3b5af9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ /plugins/menu/** /plugins/startup/** /plugins/shutdown/** +/plugins/event/** +/plugins/chatGPT/** /macros/*.ubam /macros/save /tmp @@ -83,7 +85,6 @@ uba.sh util/GitHubCustomRepoCache.py /ip_blacklist.txt /ip_whitelist.txt -plugins/event/*.py secrets/github/*.txt config.ini disabled_modules.txt @@ -110,7 +111,6 @@ UniqueBibleApp.bat UniqueBibleAppTerminal.bat new.mp3 config.py_init -plugins/chatGPT* iconfile.icns tmpicns.rsrc .stop_chatgpt diff --git a/setup.py b/setup.py index db43e1b7dd..d6621fb8d8 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ # https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/ setup( name=package, - version="0.0.2", + version="0.0.3", 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, diff --git a/uniquebible/gui/DownloadBibleMp3Dialog.py b/uniquebible/gui/DownloadBibleMp3Dialog.py index 9c5880d465..2367b13252 100644 --- a/uniquebible/gui/DownloadBibleMp3Dialog.py +++ b/uniquebible/gui/DownloadBibleMp3Dialog.py @@ -499,7 +499,8 @@ def displayMessage(self, text): pass def main(): - import sys, config + import sys + from uniquebible import config if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QApplication from PySide6.QtCore import QCoreApplication diff --git a/uniquebible/gui/Worker.py b/uniquebible/gui/Worker.py index 0ac78c4eb5..69e36e7596 100644 --- a/uniquebible/gui/Worker.py +++ b/uniquebible/gui/Worker.py @@ -90,7 +90,7 @@ def __init__(self, parent): self.threadpool = QThreadPool() def fineTunePythonCode(self, code): - insert_string = "import config\nconfig.pythonFunctionResponse = " + insert_string = "from uniquebible import config\nconfig.pythonFunctionResponse = " code = re.sub("^!(.*?)$", r"import os\nos.system(\1)", code, flags=re.M) if "\n" in code: substrings = code.rsplit("\n", 1) @@ -287,7 +287,7 @@ def getResponse(self, messages, progress_callback, functionJustCalled=False): if function_name == "python": config.pythonFunctionResponse = "" function_args = response_message["function_call"]["arguments"] - insert_string = "import config\nconfig.pythonFunctionResponse = " + insert_string = "from uniquebible import config\nconfig.pythonFunctionResponse = " if "\n" in function_args: substrings = function_args.rsplit("\n", 1) new_function_args = f"{substrings[0]}\n{insert_string}{substrings[-1]}" diff --git a/uniquebible/plugins/chatGPT/000_UBA.py b/uniquebible/plugins/chatGPT/000_UBA.py index e19ffd661a..fdb94616e1 100644 --- a/uniquebible/plugins/chatGPT/000_UBA.py +++ b/uniquebible/plugins/chatGPT/000_UBA.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config # General diff --git a/uniquebible/plugins/chatGPT/execute python code.py b/uniquebible/plugins/chatGPT/execute python code.py index 2ac8a76691..da92ef2d15 100644 --- a/uniquebible/plugins/chatGPT/execute python code.py +++ b/uniquebible/plugins/chatGPT/execute python code.py @@ -1,4 +1,5 @@ -import config, json, re +from uniquebible import config +import json, re # ChatGPT-GUI plugin: Instruct ChatGPT to excute python code directly in response to user input @@ -22,7 +23,7 @@ def run_python(function_args): def fineTunePythonCode(code): - insert_string = "import config\nconfig.pythonFunctionResponse = " + insert_string = "from uniquebible import config\nconfig.pythonFunctionResponse = " code = re.sub("^!(.*?)$", r"import os\nos.system(\1)", code, flags=re.M) if "\n" in code: substrings = code.rsplit("\n", 1) diff --git a/uniquebible/plugins/chatGPT/integrate google searches.py b/uniquebible/plugins/chatGPT/integrate google searches.py index 74aba40734..fe5eba2922 100644 --- a/uniquebible/plugins/chatGPT/integrate google searches.py +++ b/uniquebible/plugins/chatGPT/integrate google searches.py @@ -1,4 +1,5 @@ -import config, json, googlesearch +from uniquebible import config +import json, googlesearch # Use google https://pypi.org/project/googlesearch-python/ to search internet for information, about which ChatGPT doesn't know. diff --git a/uniquebible/plugins/context/Charts and Table.py b/uniquebible/plugins/context/Charts and Table.py index 49bee5b2ef..9f28be61a2 100644 --- a/uniquebible/plugins/context/Charts and Table.py +++ b/uniquebible/plugins/context/Charts and Table.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.BibleVerseParser import BibleVerseParser from gui.WebEngineViewPopover import WebEngineViewPopover if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/context/English Dictionaries_Ctrl+Shift+D.py b/uniquebible/plugins/context/English Dictionaries_Ctrl+Shift+D.py index 9a85ccd963..d5bec2aa04 100644 --- a/uniquebible/plugins/context/English Dictionaries_Ctrl+Shift+D.py +++ b/uniquebible/plugins/context/English Dictionaries_Ctrl+Shift+D.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.pluginContext and hasattr(config, "lemmatizer"): lemma = config.lemmatizer.lemmatize(config.pluginContext) diff --git a/uniquebible/plugins/context/Gmail.py b/uniquebible/plugins/context/Gmail.py index d992fa4f30..1870bb5814 100644 --- a/uniquebible/plugins/context/Gmail.py +++ b/uniquebible/plugins/context/Gmail.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/context/Google.py b/uniquebible/plugins/context/Google.py index 7855dc007b..cc45c5d3b1 100644 --- a/uniquebible/plugins/context/Google.py +++ b/uniquebible/plugins/context/Google.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/context/Insert References into Note Editor.py b/uniquebible/plugins/context/Insert References into Note Editor.py index cfbfa884f2..b95bf41067 100644 --- a/uniquebible/plugins/context/Insert References into Note Editor.py +++ b/uniquebible/plugins/context/Insert References into Note Editor.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.BibleVerseParser import BibleVerseParser if config.pluginContext: diff --git a/uniquebible/plugins/context/Insert Text into Note Editor_Ctrl+Shift+J.py b/uniquebible/plugins/context/Insert Text into Note Editor_Ctrl+Shift+J.py index 80af147c1f..b63df89023 100644 --- a/uniquebible/plugins/context/Insert Text into Note Editor_Ctrl+Shift+J.py +++ b/uniquebible/plugins/context/Insert Text into Note Editor_Ctrl+Shift+J.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.pluginContext: config.mainWindow.showNoteEditor() diff --git a/uniquebible/plugins/context/Interlinear Data.py b/uniquebible/plugins/context/Interlinear Data.py index 736c6d08c3..95f8bf62e3 100644 --- a/uniquebible/plugins/context/Interlinear Data.py +++ b/uniquebible/plugins/context/Interlinear Data.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QWidget else: diff --git a/uniquebible/plugins/context/Louw-Nida Lexicon Gloss.py b/uniquebible/plugins/context/Louw-Nida Lexicon Gloss.py index 6f253857cf..44c75dc716 100644 --- a/uniquebible/plugins/context/Louw-Nida Lexicon Gloss.py +++ b/uniquebible/plugins/context/Louw-Nida Lexicon Gloss.py @@ -1,5 +1,5 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/context/Microsoft Outlook.py b/uniquebible/plugins/context/Microsoft Outlook.py index e3d35d7bcf..4436106d1c 100644 --- a/uniquebible/plugins/context/Microsoft Outlook.py +++ b/uniquebible/plugins/context/Microsoft Outlook.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.TextUtil import TextUtil from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/context/Presentation_Ctrl+Shift+Y.py b/uniquebible/plugins/context/Presentation_Ctrl+Shift+Y.py index fd94a0873c..3c74b2ef03 100644 --- a/uniquebible/plugins/context/Presentation_Ctrl+Shift+Y.py +++ b/uniquebible/plugins/context/Presentation_Ctrl+Shift+Y.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config presentationParser = config.presentationParser diff --git a/uniquebible/plugins/context/Read All Verses.py b/uniquebible/plugins/context/Read All Verses.py index 4235a6d977..75a5875198 100644 --- a/uniquebible/plugins/context/Read All Verses.py +++ b/uniquebible/plugins/context/Read All Verses.py @@ -1,6 +1,7 @@ # This plugin is written for non-Windows device. This is not tested on Windows platform. -import config, re, os, platform +from uniquebible import config +import re, os, platform from util.WebtopUtil import WebtopUtil def findText(html): diff --git a/uniquebible/plugins/context/Run as Command_Ctrl+D.py b/uniquebible/plugins/context/Run as Command_Ctrl+D.py index c5cb8ff2fa..54a840d6d8 100755 --- a/uniquebible/plugins/context/Run as Command_Ctrl+D.py +++ b/uniquebible/plugins/context/Run as Command_Ctrl+D.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.pluginContext: useLiteVerseParsing = config.useLiteVerseParsing diff --git a/uniquebible/plugins/context/Search Bible for English Word Forms.py b/uniquebible/plugins/context/Search Bible for English Word Forms.py index 1aa4871c9e..c82ef2af1b 100644 --- a/uniquebible/plugins/context/Search Bible for English Word Forms.py +++ b/uniquebible/plugins/context/Search Bible for English Word Forms.py @@ -1,6 +1,6 @@ # This plugin search currently opened bible for all forms of selected English word. -import config +from uniquebible import config if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QWidget else: diff --git a/uniquebible/plugins/context/Strong Number to CSV.py b/uniquebible/plugins/context/Strong Number to CSV.py index 591437d0b0..e54adca462 100644 --- a/uniquebible/plugins/context/Strong Number to CSV.py +++ b/uniquebible/plugins/context/Strong Number to CSV.py @@ -1,4 +1,5 @@ -import config, re, os, sys, subprocess, platform +from uniquebible import config +import re, os, sys, subprocess, platform if config.pluginContext: if re.match("^[GH][0-9]+?$", config.pluginContext): diff --git a/uniquebible/plugins/context/YouTube Downloader.py b/uniquebible/plugins/context/YouTube Downloader.py index b9455fbaed..6a1441ca8b 100644 --- a/uniquebible/plugins/context/YouTube Downloader.py +++ b/uniquebible/plugins/context/YouTube Downloader.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.TextUtil import TextUtil if config.pluginContext: diff --git a/uniquebible/plugins/context/YouTube.py b/uniquebible/plugins/context/YouTube.py index 7b44fe7d83..0317380b97 100644 --- a/uniquebible/plugins/context/YouTube.py +++ b/uniquebible/plugins/context/YouTube.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Bible Characters.py b/uniquebible/plugins/menu/Bible Characters.py index 7656ad9a56..2297be9fbe 100644 --- a/uniquebible/plugins/menu/Bible Characters.py +++ b/uniquebible/plugins/menu/Bible Characters.py @@ -1,4 +1,5 @@ -import config, os, apsw, re, webbrowser +from uniquebible import config +import os, apsw, re, webbrowser from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import ExlbData from db.BiblesSqlite import BiblesSqlite diff --git a/uniquebible/plugins/menu/Bible Chat.py b/uniquebible/plugins/menu/Bible Chat.py index aa8a4c56af..a8e709cb79 100644 --- a/uniquebible/plugins/menu/Bible Chat.py +++ b/uniquebible/plugins/menu/Bible Chat.py @@ -1,4 +1,5 @@ -import config, os, re, openai, tiktoken, sqlite3, webbrowser, shutil, platform +from uniquebible import config +import os, re, openai, tiktoken, sqlite3, webbrowser, shutil, platform import subprocess, traceback, sys import urllib.parse from io import StringIO diff --git a/uniquebible/plugins/menu/Bible Commentaries.py b/uniquebible/plugins/menu/Bible Commentaries.py index 98019af384..e5342ea713 100644 --- a/uniquebible/plugins/menu/Bible Commentaries.py +++ b/uniquebible/plugins/menu/Bible Commentaries.py @@ -1,4 +1,5 @@ -import config, os, re +from uniquebible import config +import os, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import Commentary from db.BiblesSqlite import BiblesSqlite diff --git a/uniquebible/plugins/menu/Bible Data.py b/uniquebible/plugins/menu/Bible Data.py index 39cf40f660..b5a96ff611 100644 --- a/uniquebible/plugins/menu/Bible Data.py +++ b/uniquebible/plugins/menu/Bible Data.py @@ -1,4 +1,5 @@ -import config, os, shutil, re, webbrowser +from uniquebible import config +import os, shutil, re, webbrowser from db.BiblesSqlite import BiblesSqlite from util.BibleVerseParser import BibleVerseParser from util.FileUtil import FileUtil diff --git a/uniquebible/plugins/menu/Bible Dictionaries.py b/uniquebible/plugins/menu/Bible Dictionaries.py index 45259c2a35..a0720ba1f9 100644 --- a/uniquebible/plugins/menu/Bible Dictionaries.py +++ b/uniquebible/plugins/menu/Bible Dictionaries.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import DictionaryData if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Bible Encyclopedia.py b/uniquebible/plugins/menu/Bible Encyclopedia.py index d78bc00d63..2eb8ffaeb2 100644 --- a/uniquebible/plugins/menu/Bible Encyclopedia.py +++ b/uniquebible/plugins/menu/Bible Encyclopedia.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import EncyclopediaData if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Bible Lexicons.py b/uniquebible/plugins/menu/Bible Lexicons.py index 0d8950ff2c..11fac5b74c 100644 --- a/uniquebible/plugins/menu/Bible Lexicons.py +++ b/uniquebible/plugins/menu/Bible Lexicons.py @@ -1,4 +1,5 @@ -import config, os +from uniquebible import config +import os from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import Lexicon if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Bible Locations.py b/uniquebible/plugins/menu/Bible Locations.py index 7d9c73b0f3..3f2aeb12fd 100644 --- a/uniquebible/plugins/menu/Bible Locations.py +++ b/uniquebible/plugins/menu/Bible Locations.py @@ -1,4 +1,5 @@ -import config, gmplot, os, webbrowser, re +from uniquebible import config +import gmplot, os, webbrowser, re from util.exlbl import allLocations from gui.CheckableComboBox import CheckableComboBox from gui.WebEngineViewPopover import WebEngineViewPopover diff --git a/uniquebible/plugins/menu/Bible Parallels.py b/uniquebible/plugins/menu/Bible Parallels.py index adecdd94af..12a0841c42 100644 --- a/uniquebible/plugins/menu/Bible Parallels.py +++ b/uniquebible/plugins/menu/Bible Parallels.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.BiblesSqlite import BiblesSqlite from util.BibleVerseParser import BibleVerseParser diff --git a/uniquebible/plugins/menu/Bible Promises.py b/uniquebible/plugins/menu/Bible Promises.py index 298526aff3..1684191057 100644 --- a/uniquebible/plugins/menu/Bible Promises.py +++ b/uniquebible/plugins/menu/Bible Promises.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.BiblesSqlite import BiblesSqlite from util.BibleVerseParser import BibleVerseParser diff --git a/uniquebible/plugins/menu/Bible Timelines.py b/uniquebible/plugins/menu/Bible Timelines.py index 6c94fe721d..a30a3bcf4f 100644 --- a/uniquebible/plugins/menu/Bible Timelines.py +++ b/uniquebible/plugins/menu/Bible Timelines.py @@ -1,4 +1,5 @@ -import config, os +from uniquebible import config +import os from gui.ImageViewer import ImageViewer from util.BibleBooks import BibleBooks diff --git a/uniquebible/plugins/menu/Bible Topics.py b/uniquebible/plugins/menu/Bible Topics.py index 2d10f66df1..82b499196f 100644 --- a/uniquebible/plugins/menu/Bible Topics.py +++ b/uniquebible/plugins/menu/Bible Topics.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.ToolsSqlite import ExlbData if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Bible.py b/uniquebible/plugins/menu/Bible.py index 1d9868a75d..9b57221e82 100644 --- a/uniquebible/plugins/menu/Bible.py +++ b/uniquebible/plugins/menu/Bible.py @@ -1,4 +1,5 @@ -import config, os, re +from uniquebible import config +import os, re from gui.WebEngineViewPopover import WebEngineViewPopover from db.BiblesSqlite import BiblesSqlite, Bible from util.BibleBooks import BibleBooks diff --git a/uniquebible/plugins/menu/ChatGPT.py b/uniquebible/plugins/menu/ChatGPT.py index 5e386f7f5c..0cb48946d0 100644 --- a/uniquebible/plugins/menu/ChatGPT.py +++ b/uniquebible/plugins/menu/ChatGPT.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Display Word Frequency.py b/uniquebible/plugins/menu/Display Word Frequency.py index 72a674cdae..524ab0835a 100644 --- a/uniquebible/plugins/menu/Display Word Frequency.py +++ b/uniquebible/plugins/menu/Display Word Frequency.py @@ -1,5 +1,5 @@ import os -import config +from uniquebible import config from util.BibleBooks import BibleBooks filename = os.path.join(config.marvelData, 'statistics', 'words.stats') diff --git a/uniquebible/plugins/menu/Extract Text.py b/uniquebible/plugins/menu/Extract Text.py index 8caad2eaf7..4802ccbace 100644 --- a/uniquebible/plugins/menu/Extract Text.py +++ b/uniquebible/plugins/menu/Extract Text.py @@ -1,4 +1,5 @@ -import config, sys, os +from uniquebible import config +import sys, os from install.module import * if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QFileDialog diff --git a/uniquebible/plugins/menu/Gmail.py b/uniquebible/plugins/menu/Gmail.py index c6b98c8f27..f5a9757f67 100644 --- a/uniquebible/plugins/menu/Gmail.py +++ b/uniquebible/plugins/menu/Gmail.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Google Drive Backup.py b/uniquebible/plugins/menu/Google Drive Backup.py index 93105ab1a4..67ee9e15bf 100644 --- a/uniquebible/plugins/menu/Google Drive Backup.py +++ b/uniquebible/plugins/menu/Google Drive Backup.py @@ -1,4 +1,5 @@ -import subprocess, sys, os, config +import subprocess, sys, os +from uniquebible import config try: from plugins.menu.GoogleDriveUtility.install import * diff --git a/uniquebible/plugins/menu/Google Drive Restore.py b/uniquebible/plugins/menu/Google Drive Restore.py index 7dcd04ac61..22e68af351 100644 --- a/uniquebible/plugins/menu/Google Drive Restore.py +++ b/uniquebible/plugins/menu/Google Drive Restore.py @@ -1,4 +1,5 @@ -import subprocess, sys, os, config +import subprocess, sys, os +from uniquebible import config try: from plugins.menu.GoogleDriveUtility.install import * from googleapiclient.discovery import build diff --git a/uniquebible/plugins/menu/Google.py b/uniquebible/plugins/menu/Google.py index 212f95ee9a..6698080f75 100644 --- a/uniquebible/plugins/menu/Google.py +++ b/uniquebible/plugins/menu/Google.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser from util.TextUtil import TextUtil if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Interlinear Data.py b/uniquebible/plugins/menu/Interlinear Data.py index 94f402f7ff..e38079f90d 100644 --- a/uniquebible/plugins/menu/Interlinear Data.py +++ b/uniquebible/plugins/menu/Interlinear Data.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QWidget else: diff --git a/uniquebible/plugins/menu/Journal and Bible Reading Plan.py b/uniquebible/plugins/menu/Journal and Bible Reading Plan.py index 295cede31f..4c7a12521d 100644 --- a/uniquebible/plugins/menu/Journal and Bible Reading Plan.py +++ b/uniquebible/plugins/menu/Journal and Bible Reading Plan.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.readings import allDays if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QWidget diff --git a/uniquebible/plugins/menu/Microsoft Calendar.py b/uniquebible/plugins/menu/Microsoft Calendar.py index bf7c0b19bb..8a61d69a12 100644 --- a/uniquebible/plugins/menu/Microsoft Calendar.py +++ b/uniquebible/plugins/menu/Microsoft Calendar.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Excel.py b/uniquebible/plugins/menu/Microsoft Excel.py index a177e3f065..0c0097c88e 100644 --- a/uniquebible/plugins/menu/Microsoft Excel.py +++ b/uniquebible/plugins/menu/Microsoft Excel.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Forms.py b/uniquebible/plugins/menu/Microsoft Forms.py index 04345c9bba..3c03f45ae2 100644 --- a/uniquebible/plugins/menu/Microsoft Forms.py +++ b/uniquebible/plugins/menu/Microsoft Forms.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Office 365.py b/uniquebible/plugins/menu/Microsoft Office 365.py index f8da665de7..4c6f09f625 100644 --- a/uniquebible/plugins/menu/Microsoft Office 365.py +++ b/uniquebible/plugins/menu/Microsoft Office 365.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft OneDrive.py b/uniquebible/plugins/menu/Microsoft OneDrive.py index 64dfe3862e..eecda98d1b 100644 --- a/uniquebible/plugins/menu/Microsoft OneDrive.py +++ b/uniquebible/plugins/menu/Microsoft OneDrive.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft OneNote.py b/uniquebible/plugins/menu/Microsoft OneNote.py index 035c07008b..08ddfda382 100644 --- a/uniquebible/plugins/menu/Microsoft OneNote.py +++ b/uniquebible/plugins/menu/Microsoft OneNote.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Outlook.py b/uniquebible/plugins/menu/Microsoft Outlook.py index 803e6d2c54..4a2a3a2c37 100644 --- a/uniquebible/plugins/menu/Microsoft Outlook.py +++ b/uniquebible/plugins/menu/Microsoft Outlook.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from util.TextUtil import TextUtil from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/Microsoft PowerPoint.py b/uniquebible/plugins/menu/Microsoft PowerPoint.py index 2cdfa39acc..e697f9baf1 100644 --- a/uniquebible/plugins/menu/Microsoft PowerPoint.py +++ b/uniquebible/plugins/menu/Microsoft PowerPoint.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Teams.py b/uniquebible/plugins/menu/Microsoft Teams.py index 90db3e008e..29c2fdd2c8 100644 --- a/uniquebible/plugins/menu/Microsoft Teams.py +++ b/uniquebible/plugins/menu/Microsoft Teams.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Microsoft Word.py b/uniquebible/plugins/menu/Microsoft Word.py index c68df7c717..f20a0e9155 100644 --- a/uniquebible/plugins/menu/Microsoft Word.py +++ b/uniquebible/plugins/menu/Microsoft Word.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config from gui.SimpleBrowser import SimpleBrowser if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl diff --git a/uniquebible/plugins/menu/Presentation.py b/uniquebible/plugins/menu/Presentation.py index e1dd967683..1af82fdc2f 100644 --- a/uniquebible/plugins/menu/Presentation.py +++ b/uniquebible/plugins/menu/Presentation.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config import sys if config.qtLibrary == "pyside6": from PySide6.QtWidgets import QApplication, QWidget diff --git a/uniquebible/plugins/menu/Reference Books.py b/uniquebible/plugins/menu/Reference Books.py index 9e7cdfbd27..cb1c782820 100644 --- a/uniquebible/plugins/menu/Reference Books.py +++ b/uniquebible/plugins/menu/Reference Books.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from util.ThirdParty import ThirdPartyDictionary from db.ToolsSqlite import Book, BookData diff --git a/uniquebible/plugins/menu/Terminal Mode.py b/uniquebible/plugins/menu/Terminal Mode.py index ed54c2e5ae..67fc9dcb4c 100644 --- a/uniquebible/plugins/menu/Terminal Mode.py +++ b/uniquebible/plugins/menu/Terminal Mode.py @@ -1,4 +1,5 @@ -import os, subprocess, config, platform, sys +import os, subprocess, platform, sys +from uniquebible import config from util.WebtopUtil import WebtopUtil cwd = os.getcwd() diff --git a/uniquebible/plugins/menu/Terminal.py b/uniquebible/plugins/menu/Terminal.py index 012d1c5584..5da41356cd 100644 --- a/uniquebible/plugins/menu/Terminal.py +++ b/uniquebible/plugins/menu/Terminal.py @@ -1,4 +1,5 @@ -import platform, subprocess, config +import platform, subprocess +from uniquebible import config thisPlatform = platform.system() commands = { diff --git a/uniquebible/plugins/menu/Third Party Dictionaries.py b/uniquebible/plugins/menu/Third Party Dictionaries.py index 7ea73c0b3a..fc6e2dfee1 100644 --- a/uniquebible/plugins/menu/Third Party Dictionaries.py +++ b/uniquebible/plugins/menu/Third Party Dictionaries.py @@ -1,4 +1,5 @@ -import config, os, apsw, re +from uniquebible import config +import os, apsw, re from gui.WebEngineViewPopover import WebEngineViewPopover from util.ThirdParty import ThirdPartyDictionary if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/ToDo.py b/uniquebible/plugins/menu/ToDo.py index b873d18087..c6e10cd26e 100644 --- a/uniquebible/plugins/menu/ToDo.py +++ b/uniquebible/plugins/menu/ToDo.py @@ -1,4 +1,5 @@ -import config, os, shutil +from uniquebible import config +import os, shutil from datetime import date from db.JournalSqlite import JournalSqlite if config.qtLibrary == "pyside6": diff --git a/uniquebible/plugins/menu/ePub Viewer Full Screen.py b/uniquebible/plugins/menu/ePub Viewer Full Screen.py index 9d40443d3a..679042cd40 100644 --- a/uniquebible/plugins/menu/ePub Viewer Full Screen.py +++ b/uniquebible/plugins/menu/ePub Viewer Full Screen.py @@ -1,4 +1,5 @@ -import config, os, platform +from uniquebible import config +import os, platform if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl else: diff --git a/uniquebible/plugins/menu/ePub Viewer New Window.py b/uniquebible/plugins/menu/ePub Viewer New Window.py index b97221c682..2e2295d6cd 100644 --- a/uniquebible/plugins/menu/ePub Viewer New Window.py +++ b/uniquebible/plugins/menu/ePub Viewer New Window.py @@ -1,4 +1,5 @@ -import config, os, platform +from uniquebible import config +import os, platform if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl else: diff --git a/uniquebible/plugins/menu/ePub Viewer.py b/uniquebible/plugins/menu/ePub Viewer.py index 246cb9fa4e..491fb358d2 100644 --- a/uniquebible/plugins/menu/ePub Viewer.py +++ b/uniquebible/plugins/menu/ePub Viewer.py @@ -1,4 +1,5 @@ -import config, os, platform +from uniquebible import config +import os, platform if config.qtLibrary == "pyside6": from PySide6.QtCore import QUrl else: diff --git a/uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py b/uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py index 23856a2191..351e3db3f0 100644 --- a/uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py +++ b/uniquebible/plugins/startup/addHoverFeatureToBibleLinks.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re from util.ThirdParty import Converter def convertCrLink(match): diff --git a/uniquebible/plugins/startup/customise_terminal_mode_commands.py b/uniquebible/plugins/startup/customise_terminal_mode_commands.py index 53316d988b..53b287c072 100644 --- a/uniquebible/plugins/startup/customise_terminal_mode_commands.py +++ b/uniquebible/plugins/startup/customise_terminal_mode_commands.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.runMode == "terminal": # Add new command diff --git a/uniquebible/plugins/startup/customise_terminal_mode_key_bindings.py b/uniquebible/plugins/startup/customise_terminal_mode_key_bindings.py index 740a32417a..d1d528fc91 100644 --- a/uniquebible/plugins/startup/customise_terminal_mode_key_bindings.py +++ b/uniquebible/plugins/startup/customise_terminal_mode_key_bindings.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config if config.runMode == "terminal": diff --git a/uniquebible/plugins/startup/fixDisplayColour.py b/uniquebible/plugins/startup/fixDisplayColour.py index ce36839d42..8a6c702bab 100644 --- a/uniquebible/plugins/startup/fixDisplayColour.py +++ b/uniquebible/plugins/startup/fixDisplayColour.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config def fixDisplayColourDarkTheme(text): searchReplace = ( diff --git a/uniquebible/plugins/startup/fixHrefLinks.py b/uniquebible/plugins/startup/fixHrefLinks.py index a11fd98ba3..e382e48d65 100644 --- a/uniquebible/plugins/startup/fixHrefLinks.py +++ b/uniquebible/plugins/startup/fixHrefLinks.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re def fixHrefLinks(text): if config.enableHttpServer: diff --git a/uniquebible/plugins/startup/fixNonHtmlColour.py b/uniquebible/plugins/startup/fixNonHtmlColour.py index 7c08d0ba70..0b092129ff 100644 --- a/uniquebible/plugins/startup/fixNonHtmlColour.py +++ b/uniquebible/plugins/startup/fixNonHtmlColour.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re def fixTextColour(text): return re.sub("""(.*?)""", r"\1", text) diff --git a/uniquebible/plugins/startup/highlightActiveVerse.py b/uniquebible/plugins/startup/highlightActiveVerse.py index 310df1536e..c38be9b7b6 100644 --- a/uniquebible/plugins/startup/highlightActiveVerse.py +++ b/uniquebible/plugins/startup/highlightActiveVerse.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re terminalTextStart = """「tmvs fg="{1}" bg="{0}"」{2}「/tmvs」""".format(config.terminalSearchHighlightBackground, config.terminalSearchHighlightForeground, config.terminalVerseSelectionStart) if config.runMode == "terminal" else "" terminalTextEnd = """ 「tmvs fg="{1}" bg="{0}"」{2}「/tmvs」""".format(config.terminalSearchHighlightBackground, config.terminalSearchHighlightForeground, config.terminalVerseSelectionEnd) if config.runMode == "terminal" else "" diff --git a/uniquebible/plugins/startup/keywordAlias.py b/uniquebible/plugins/startup/keywordAlias.py index 90d686d61f..76ca38440d 100644 --- a/uniquebible/plugins/startup/keywordAlias.py +++ b/uniquebible/plugins/startup/keywordAlias.py @@ -1,4 +1,4 @@ -import config +from uniquebible import config shortcuts = ( ("diff", "DIFFERENCE", config.mainWindow.textCommandParser.textDiff), diff --git a/uniquebible/plugins/startup/qrCodeCommand.py b/uniquebible/plugins/startup/qrCodeCommand.py index e3026ffe92..c37cceb8a4 100644 --- a/uniquebible/plugins/startup/qrCodeCommand.py +++ b/uniquebible/plugins/startup/qrCodeCommand.py @@ -1,5 +1,5 @@ import os -import config +from uniquebible import config from util.NetworkUtil import NetworkUtil def qrCodeCmd(command, source): diff --git a/uniquebible/plugins/startup/screenCommand.py b/uniquebible/plugins/startup/screenCommand.py index 58962b7049..0c7256bc19 100644 --- a/uniquebible/plugins/startup/screenCommand.py +++ b/uniquebible/plugins/startup/screenCommand.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re from util.BibleVerseParser import BibleVerseParser from db.BiblesSqlite import BiblesSqlite from db.ToolsSqlite import Book diff --git a/uniquebible/plugins/startup/tagLexicalEntry.py b/uniquebible/plugins/startup/tagLexicalEntry.py index 4b9ee9d560..7a7bd9203e 100644 --- a/uniquebible/plugins/startup/tagLexicalEntry.py +++ b/uniquebible/plugins/startup/tagLexicalEntry.py @@ -6,7 +6,8 @@ e.g. H1234 """ -import config, re +from uniquebible import config +import re def tagLexicalEntry(text): diff --git a/uniquebible/plugins/startup/transformSingleVerseLinkToRange.py b/uniquebible/plugins/startup/transformSingleVerseLinkToRange.py index 19d7418876..5004268d26 100644 --- a/uniquebible/plugins/startup/transformSingleVerseLinkToRange.py +++ b/uniquebible/plugins/startup/transformSingleVerseLinkToRange.py @@ -1,4 +1,5 @@ -import config, re +from uniquebible import config +import re def transformSingleVerseLinkToRange(text): return re.sub(r'onmouseover="imv\(([0-9]+?),([0-9]+?),([0-9]+?)\)">([1-4A-Za-z]+? )\2:\3-([0-9]+?)([^0-9])', r'onmouseover="imv(\1,\2,\3,\2,\5)">\4\2:\3-\5\6', text) diff --git a/uniquebible/util/DatafileLocation.py b/uniquebible/util/DatafileLocation.py index 4d175039eb..381a8bd20e 100644 --- a/uniquebible/util/DatafileLocation.py +++ b/uniquebible/util/DatafileLocation.py @@ -133,7 +133,8 @@ class DatafileLocation: } #if __name__ == "__main__": -# import os, config +# import os +# from uniquebible import config # # def installResources(resources): # count = 0 diff --git a/uniquebible/util/LocalCliHandler.py b/uniquebible/util/LocalCliHandler.py index 950c5baf17..c14c82a353 100644 --- a/uniquebible/util/LocalCliHandler.py +++ b/uniquebible/util/LocalCliHandler.py @@ -2237,7 +2237,7 @@ def spinning_animation(self, stop_event): time.sleep(0.1) def fineTunePythonCode(self, code): - insert_string = "import config\nconfig.pythonFunctionResponse = " + insert_string = "from uniquebible import config\nconfig.pythonFunctionResponse = " code = re.sub("^!(.*?)$", r"import os\nos.system(\1)", code, flags=re.M) if "\n" in code: substrings = code.rsplit("\n", 1)