mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 03:08:29 +02:00
use import instead of using sys.modules to avoid a useless sys import
This commit is contained in:
parent
7d7df10217
commit
222886e009
3 changed files with 3 additions and 10 deletions
4
main.pyw
4
main.pyw
|
@ -1,12 +1,10 @@
|
||||||
import sys
|
|
||||||
|
|
||||||
from source.gui import install
|
from source.gui import install
|
||||||
from source.option import Option
|
from source.option import Option
|
||||||
from source.translation import load_language
|
from source.translation import load_language
|
||||||
|
|
||||||
|
|
||||||
# this allows every variable to be accessible from other files, useful for the plugins
|
# 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")
|
options = Option.from_file("./option.json")
|
||||||
translater = load_language(options["language"])
|
translater = load_language(options["language"])
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
import tkinter
|
import tkinter
|
||||||
import sys
|
from __main__ import window
|
||||||
|
|
||||||
|
|
||||||
# get the main window from the main module
|
|
||||||
window = sys.modules["__main__"].window
|
|
||||||
|
|
||||||
# get the install button from the main window
|
# get the install button from the main window
|
||||||
window.button_install.config(text="installation plugins")
|
window.button_install.config(text="installation plugins")
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import json
|
import json
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
self = sys.modules[__name__]
|
self = __import__(__name__)
|
||||||
self._language_data = {}
|
self._language_data = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue