use import instead of using sys.modules to avoid a useless sys import

This commit is contained in:
Faraphel 2022-08-02 17:57:46 +02:00
parent 7d7df10217
commit 222886e009
3 changed files with 3 additions and 10 deletions

View file

@ -1,12 +1,10 @@
import sys
from source.gui import install
from source.option import Option
from source.translation import load_language
# this allows every variable to be accessible from other files, useful for the plugins
self = sys.modules[__name__]
self = __import__(__name__)
options = Option.from_file("./option.json")
translater = load_language(options["language"])

View file

@ -1,9 +1,5 @@
import tkinter
import sys
# get the main window from the main module
window = sys.modules["__main__"].window
from __main__ import window
# get the install button from the main window
window.button_install.config(text="installation plugins")

View file

@ -1,9 +1,8 @@
import json
import sys
from pathlib import Path
self = sys.modules[__name__]
self = __import__(__name__)
self._language_data = {}