Skip to content

Commit

Permalink
Updated JSON path from relative to absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
redwan-hossain committed Oct 22, 2022
1 parent 7241d74 commit a25946c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ ortho.db
trial.py
bangla_words.xml
word_db_english.json
ortho_ui.py
ortho_ui.py
build_commands.txt
Ortho_Dictionary.spec
Ortho_Dictionary-x86_64.AppImage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
- Then run YDM by this command: `python3 ortho.py`

- The very first run may take some time because the of the extraction process of the sqlite database.

3 changes: 2 additions & 1 deletion ortho.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
class Main_Ui(QMainWindow):
UI_FILE = os.path.join(BASE_DIR, "ortho.ui")
DB_PATH = os.path.join(BASE_DIR, "ortho.db")
BN_JSON_DB_PATH = os.path.join(BASE_DIR, "word_db_bangla.json")

if not os.path.exists(DB_PATH):
print("Extracting DataBase")
Expand All @@ -36,7 +37,7 @@ def init_db_connection(self):
self.DB_CONNECTION = sqlite3.connect(self.DB_PATH)

def init_json_bn_db(self):
with open("word_db_bangla.json") as json_file:
with open(f"{self.BN_JSON_DB_PATH}") as json_file:
self.JSON_BN_DB = json.load(json_file)

def __init__(self):
Expand Down

0 comments on commit a25946c

Please sign in to comment.